#include #include #include #include #include #include "Builder.h" #include "RandomSpawner.h" namespace kurator { namespace sim { void load_scenario(State& ctx, const campaign::Scenario& scenario) { RandomSpawner spawner {scenario.last_team(), scenario.radius, 0.1}; Builder build {ctx.registry, spawner}; for (const auto& ship : scenario.ships) { const auto entity = build(ship.loadout.type, ship.team); ctx.registry.emplace(entity, ship.identifier); auto& state = ctx.registry.get(entity); 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); } } } } // namespace sim } // namespace kurator