summaryrefslogtreecommitdiff
path: root/sim/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-12-13 18:58:56 +0100
committerAki <please@ignore.pl>2022-12-13 18:58:56 +0100
commit867393652a1199d4803c5707902f215f36c45350 (patch)
treeac6599385ab234f00716ae54abcb1716bcababc2 /sim/src
parent6e3c3628687186eb17c819af2e30082fe81fc555 (diff)
downloadkurator-867393652a1199d4803c5707902f215f36c45350.zip
kurator-867393652a1199d4803c5707902f215f36c45350.tar.gz
kurator-867393652a1199d4803c5707902f215f36c45350.tar.bz2
Added naive campaign-unique ship identifiers
Diffstat (limited to 'sim/src')
-rw-r--r--sim/src/BaseBattle.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sim/src/BaseBattle.cpp b/sim/src/BaseBattle.cpp
index b85c0eb..87b2096 100644
--- a/sim/src/BaseBattle.cpp
+++ b/sim/src/BaseBattle.cpp
@@ -4,6 +4,7 @@
#include <entt/signal/dispatcher.hpp>
#include <kurator/campaign/Scenario.h>
+#include <kurator/campaign/UniqueIdentifier.h>
#include <kurator/sim/components.h>
#include <kurator/sim/events.h>
#include <kurator/universe.h>
@@ -25,6 +26,7 @@ BaseBattle::BaseBattle(const campaign::Scenario& scenario) :
Builder build {_registry, spawner};
for (const auto& ship : scenario.ships) {
const auto entity = build(repo->ship_type(ship.type), ship.team);
+ _registry.emplace<campaign::UniqueIdentifier>(entity, ship.identifier);
for (const auto& turret_type : ship.turrets)
build(repo->turret_type(turret_type), entity);
manager.add(ship.team, entity); // registry supports on construction events