#include "Builder.h" #include #include #include #include #include #include #include #include #include "Spawner.h" namespace kurator { namespace sim { using engine::Point; Builder::Builder(entt::registry& _registry, Spawner& _spawner) : registry {_registry}, spawner {_spawner} { } entt::entity Builder::operator()(const universe::ShipType& ship_type, const int team) const { const auto entity = registry.create(); registry.emplace(entity, ship_type); registry.emplace(entity, team); registry.emplace(entity, spawner.get(team)); registry.emplace( entity, ship_type.max_speed, ship_type.max_speed * 2.0, ship_type.max_speed * 3.0); registry.emplace(entity, 15000.0, Point{0.0, 0.0}); registry.emplace(entity, ship_type); return entity; } entt::entity Builder::operator()(const universe::TurretType& turret_type, const entt::entity& owner) const { const auto entity = registry.create(); registry.emplace(entity, turret_type); registry.emplace(entity, 0.0, 0.0, turret_type.rounds, owner); registry.emplace(entity, Point{0.0, 0.0}, 0.0, owner); return entity; } } // namespace sim } // namespace kurator