diff options
author | Aki <please@ignore.pl> | 2023-04-27 00:36:46 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-04-05 19:41:19 +0200 |
commit | 61d16477b01bcfbe8c3a481a232658ac60309f57 (patch) | |
tree | 06882f5a1b7bc987826610736a5b606883df69b9 /sim/src/sim.cpp | |
parent | 94d6d863e1b78766cdb5f286e3d9f374c02c5d33 (diff) | |
download | kurator-61d16477b01bcfbe8c3a481a232658ac60309f57.zip kurator-61d16477b01bcfbe8c3a481a232658ac60309f57.tar.gz kurator-61d16477b01bcfbe8c3a481a232658ac60309f57.tar.bz2 |
Extracted KeepAtRange action
It seems an abstraction level is of some kind is needed here. One thing
to handle "AI", another to handle primitive commands and their
execution.
Diffstat (limited to 'sim/src/sim.cpp')
-rw-r--r-- | sim/src/sim.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sim/src/sim.cpp b/sim/src/sim.cpp index 740e6af..879f7fb 100644 --- a/sim/src/sim.cpp +++ b/sim/src/sim.cpp @@ -1,7 +1,6 @@ #include <kurator/sim.h> #include <kurator/campaign/Scenario.h> -#include <kurator/sim/ai.h> #include <kurator/sim/State.h> #include <kurator/sim/System.h> #include <kurator/universe/UniqueIdentifier.h> @@ -26,11 +25,8 @@ load_scenario(const campaign::Scenario& scenario) for (const auto& ship : scenario.ships) { const auto entity = build(ship.loadout.type, ship.team); ctx.registry.emplace<universe::UniqueIdentifier>(entity, ship.identifier); - auto& state = ctx.registry.get<AIShip>(entity); - for (const auto& turret_type : ship.loadout.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); - } } return ctx; } |