Now have a 'destroy' method that removes everything related to an entity. Closes #18.

This commit is contained in:
Zed A. Shaw 2025-06-28 12:47:17 -04:00
parent 7602fb0b31
commit 6437bd3b54
2 changed files with 26 additions and 8 deletions

View file

@ -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));
}