summaryrefslogtreecommitdiff
path: root/sim/src
diff options
context:
space:
mode:
Diffstat (limited to 'sim/src')
-rw-r--r--sim/src/BaseBattle.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/sim/src/BaseBattle.cpp b/sim/src/BaseBattle.cpp
index f195181..037a818 100644
--- a/sim/src/BaseBattle.cpp
+++ b/sim/src/BaseBattle.cpp
@@ -12,7 +12,6 @@
#include <kurator/sim/HitPoints.h>
#include <kurator/sim/TurretControl.h>
#include <kurator/stats/events.h>
-#include <kurator/universe.h>
#include <kurator/universe/UniqueIdentifier.h>
#include "Builder.h"
@@ -29,16 +28,14 @@ BaseBattle::BaseBattle(const campaign::Scenario& scenario) :
_registry {},
spawner {scenario.last_team(), scenario.radius, 0.1}
{
- const auto repo = universe::load_json("resources/universe");
Builder build {_registry, spawner};
for (const auto& ship : scenario.ships) {
- const auto entity = build(repo->ship_type(ship.type), ship.team);
+ const auto entity = build(ship.type, ship.team);
_registry.emplace<universe::UniqueIdentifier>(entity, ship.identifier);
auto& state = _registry.get<AIState>(entity);
for (const auto& turret_type : ship.turrets) {
- auto def = repo->turret_type(turret_type);
- build(def, entity);
- state.keep_at_range = std::min(state.keep_at_range, def.optimal_range);
+ build(turret_type, entity);
+ state.keep_at_range = std::min(state.keep_at_range, turret_type.optimal_range);
}
manager.add(ship.team, entity); // registry supports on construction events
}