summaryrefslogtreecommitdiff
path: root/sim/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-01-10 00:57:41 +0100
committerAki <please@ignore.pl>2023-01-10 00:57:41 +0100
commit0e91fc6a8e14eebb5a89b260f66e5e74b42074bb (patch)
treeea98c193cd2822ed0ecadfbffc91b10c43792d4d /sim/src
parent9d752200d3412eeea70327d8f544877bafc5b6d2 (diff)
downloadkurator-0e91fc6a8e14eebb5a89b260f66e5e74b42074bb.zip
kurator-0e91fc6a8e14eebb5a89b260f66e5e74b42074bb.tar.gz
kurator-0e91fc6a8e14eebb5a89b260f66e5e74b42074bb.tar.bz2
Extracted ship loadout into own class
Diffstat (limited to 'sim/src')
-rw-r--r--sim/src/BaseBattle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/src/BaseBattle.cpp b/sim/src/BaseBattle.cpp
index 037a818..5173892 100644
--- a/sim/src/BaseBattle.cpp
+++ b/sim/src/BaseBattle.cpp
@@ -30,10 +30,10 @@ BaseBattle::BaseBattle(const campaign::Scenario& scenario) :
{
Builder build {_registry, spawner};
for (const auto& ship : scenario.ships) {
- const auto entity = build(ship.type, ship.team);
+ const auto entity = build(ship.loadout.type, ship.team);
_registry.emplace<universe::UniqueIdentifier>(entity, ship.identifier);
auto& state = _registry.get<AIState>(entity);
- for (const auto& turret_type : ship.turrets) {
+ for (const auto& turret_type : ship.loadout.turrets) {
build(turret_type, entity);
state.keep_at_range = std::min(state.keep_at_range, turret_type.optimal_range);
}