Now have a 'destroy' method that removes everything related to an entity. Closes #18.
This commit is contained in:
parent
7602fb0b31
commit
6437bd3b54
2 changed files with 26 additions and 8 deletions
|
@ -199,4 +199,10 @@ TEST_CASE("can destroy all entity", "[ecs-destroy]") {
|
|||
world.set<Velocity>(entity, {10,10});
|
||||
world.set<Gravity>(entity, {1});
|
||||
world.set<Motion>(entity, {0,0});
|
||||
|
||||
world.destroy(entity);
|
||||
|
||||
REQUIRE(!world.has<Velocity>(entity));
|
||||
REQUIRE(!world.has<Gravity>(entity));
|
||||
REQUIRE(!world.has<Motion>(entity));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue