summaryrefslogtreecommitdiff
path: root/battles/src/Builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'battles/src/Builder.cpp')
-rw-r--r--battles/src/Builder.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/battles/src/Builder.cpp b/battles/src/Builder.cpp
deleted file mode 100644
index d7cc893..0000000
--- a/battles/src/Builder.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "Builder.h"
-
-#include <entt/entity/registry.hpp>
-
-#include <kurator/battles/components.h>
-#include <kurator/battles/Point.h>
-#include <kurator/universe/ShipType.h>
-#include <kurator/universe/TurretType.h>
-
-#include "Spawner.h"
-
-
-namespace kurator
-{
-namespace battles
-{
-
-
-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<universe::ShipType>(entity, ship_type);
- registry.emplace<Team>(entity, team);
- registry.emplace<Transform>(entity, spawner.get(team));
- registry.emplace<FloatingMovement>(
- entity,
- ship_type.max_speed,
- ship_type.max_speed * 2.0,
- ship_type.max_speed * 3.0,
- 100.0);
- registry.emplace<AIState>(entity, Point{0.0, 0.0});
- registry.emplace<HitPoints>(entity, ship_type.base_health_points);
- return entity;
-}
-
-
-entt::entity
-Builder::operator()(const universe::TurretType& turret_type, const entt::entity& owner) const
-{
- const auto entity = registry.create();
- registry.emplace<universe::TurretType>(entity, turret_type);
- registry.emplace<TurretControl>(entity, 0.0, owner);
- registry.emplace<Transform>(entity, Point{0.0, 0.0}, 0.0, owner);
- return entity;
-}
-
-
-} // namespace battles
-} // namespace kurator