3#include "components/Dead.hpp"
7namespace rtk::systems {
24 void onStart(rtk::ecs::Registry &)
override {}
30 void update(rtk::ecs::Registry ®,
float)
override {
33 std::vector<std::size_t> toDestroy;
34 for (
auto entity : view) {
35 toDestroy.push_back(entity);
38 for (
auto entity : toDestroy) {
39 reg.remove_entity_from_all_pools(entity);
40 reg.kill_entity(entity);
47 void onStop(rtk::ecs::Registry &)
override {}
Destroys every entity tagged with Dead.
Definition DeadSystem.hpp:16
void update(rtk::ecs::Registry ®, float) override
Removes the components of dead entities and kills them.
Definition DeadSystem.hpp:30
void onStop(rtk::ecs::Registry &) override
Does nothing.
Definition DeadSystem.hpp:47
void onStart(rtk::ecs::Registry &) override
Does nothing.
Definition DeadSystem.hpp:24
Tag marking an entity for destruction at the end of the frame.
Definition Dead.hpp:17