From 867393652a1199d4803c5707902f215f36c45350 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 13 Dec 2022 18:58:56 +0100 Subject: Added naive campaign-unique ship identifiers --- sim/src/BaseBattle.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sim') 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 #include +#include #include #include #include @@ -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(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 -- cgit v1.1