diff options
author | Aki <please@ignore.pl> | 2023-01-15 17:20:10 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-01-15 17:20:10 +0100 |
commit | 6ebd267bcf026343c354fb107fb03ba800eb9aca (patch) | |
tree | 26f2f1064f14871f17ba3d2de93e5180ffaf45fa /sim | |
parent | a36ebd9b053f80e0dae1a5b50e0914d6518a01d2 (diff) | |
download | kurator-6ebd267bcf026343c354fb107fb03ba800eb9aca.zip kurator-6ebd267bcf026343c354fb107fb03ba800eb9aca.tar.gz kurator-6ebd267bcf026343c354fb107fb03ba800eb9aca.tar.bz2 |
Implemented naive on-death markers
Diffstat (limited to 'sim')
-rw-r--r-- | sim/include/kurator/sim/events.h | 6 | ||||
-rw-r--r-- | sim/src/BaseBattle.cpp | 1 |
2 files changed, 7 insertions, 0 deletions
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<universe::UniqueIdentifier, Team>(entity)) { const auto& [identifier, team] = _registry.get<universe::UniqueIdentifier, Team>(entity); _dispatcher.trigger(stats::ShipLeft{time, identifier, team.id, true}); + _dispatcher.trigger(Destroyed{entity}); } _registry.destroy(entity); } |