Skip to content

Commit

Permalink
refactor: use set entity instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Aug 19, 2024
1 parent 349cff5 commit 75963e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions manifests/dev/base/contracts/flippyflop-actions-4407e5f5.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c"
original_class_hash = "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c"
class_hash = "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802"
original_class_hash = "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802"
base_class_hash = "0x0"
abi = "manifests/dev/base/abis/contracts/flippyflop-actions-4407e5f5.json"
reads = []
Expand Down
4 changes: 2 additions & 2 deletions manifests/dev/deployment/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,8 @@
{
"kind": "DojoContract",
"address": "0x6dc710c0589d8ceb1a924c6632f4c9a8623f85c38a7e0cbed845157727b9b54",
"class_hash": "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c",
"original_class_hash": "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c",
"class_hash": "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802",
"original_class_hash": "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802",
"base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2",
"abi": [
{
Expand Down
4 changes: 2 additions & 2 deletions manifests/dev/deployment/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ manifest_name = "dojo-base"
[[contracts]]
kind = "DojoContract"
address = "0x6dc710c0589d8ceb1a924c6632f4c9a8623f85c38a7e0cbed845157727b9b54"
class_hash = "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c"
original_class_hash = "0x70d01a0eed4c6d3eb05a19dc37bb2b0660b819a4f3be1537a957d9bc45da3c"
class_hash = "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802"
original_class_hash = "0x5728ae47027cc1a450ef87fa6388d2dd47ef198f3521b85bee7be955c838802"
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2"
abi = "manifests/dev/deployment/abis/contracts/flippyflop-actions-4407e5f5.json"
reads = []
Expand Down
5 changes: 4 additions & 1 deletion src/systems/actions.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ mod actions {
let y: u32 = ((hash / 100) % 100).try_into().unwrap();

let entity_hash = poseidon_hash_span(array![x.into(), y.into()].span());
world.delete_entity_lobotomized(TILE_MODEL_SELECTOR, entity_hash);
world
.set_entity_lobotomized(
TILE_MODEL_SELECTOR, array![x.into(), y.into()].span(), entity_hash, 0
);
}
}
}

0 comments on commit 75963e2

Please sign in to comment.