#include "systems.h" #include #include #include #include #include #include namespace kurator { namespace sim { void kill_off_dead(State& ctx) { auto view = ctx.registry.view(); for (auto&& [entity, points] : view.each()) { if (points.is_alive()) continue; if (ctx.registry.all_of(entity)) { const auto& [identifier, team] = ctx.registry.get(entity); ctx.dispatcher.trigger(stats::ShipLeft{ctx.clock.game, identifier, team.id, true}); ctx.dispatcher.trigger(Destroyed{entity}); } ctx.registry.destroy(entity); } } } // namespace sim } // namespace kurator