From 6ebd267bcf026343c354fb107fb03ba800eb9aca Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 15 Jan 2023 17:20:10 +0100 Subject: Implemented naive on-death markers --- sim/include/kurator/sim/events.h | 6 ++++++ sim/src/BaseBattle.cpp | 1 + 2 files changed, 7 insertions(+) (limited to 'sim') diff --git a/sim/include/kurator/sim/events.h b/sim/include/kurator/sim/events.h index 71ce098..87cd430 100644 --- a/sim/include/kurator/sim/events.h +++ b/sim/include/kurator/sim/events.h @@ -22,5 +22,11 @@ struct End }; +struct Destroyed +{ + entt::entity victim; +}; + + } // namespace sim } // namespace kurator diff --git a/sim/src/BaseBattle.cpp b/sim/src/BaseBattle.cpp index 5173892..99a0199 100644 --- a/sim/src/BaseBattle.cpp +++ b/sim/src/BaseBattle.cpp @@ -105,6 +105,7 @@ BaseBattle::kill_off_dead() if (_registry.all_of(entity)) { const auto& [identifier, team] = _registry.get(entity); _dispatcher.trigger(stats::ShipLeft{time, identifier, team.id, true}); + _dispatcher.trigger(Destroyed{entity}); } _registry.destroy(entity); } -- cgit v1.1