summaryrefslogtreecommitdiff
path: root/battles/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-11-09 17:17:22 +0100
committerAki <please@ignore.pl>2022-11-09 17:17:22 +0100
commit9de52991aaec19076cc79b54e097444532b5300f (patch)
tree76cb87452c9604760d8218aa534c982c4ab847d1 /battles/src
parentcaa48ce5946d093daaf950751dfa1432ea5373a9 (diff)
downloadkurator-9de52991aaec19076cc79b54e097444532b5300f.zip
kurator-9de52991aaec19076cc79b54e097444532b5300f.tar.gz
kurator-9de52991aaec19076cc79b54e097444532b5300f.tar.bz2
Created naive battle setup and view into it
Diffstat (limited to 'battles/src')
-rw-r--r--battles/src/Battle.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/battles/src/Battle.cpp b/battles/src/Battle.cpp
index e185a68..699b9c4 100644
--- a/battles/src/Battle.cpp
+++ b/battles/src/Battle.cpp
@@ -1,6 +1,8 @@
#include <kurator/battles/Battle.h>
+#include <kurator/battles/components.h>
#include <kurator/battles/Scenario.h>
+#include <kurator/universe/ShipType.h>
namespace kurator
@@ -9,8 +11,17 @@ namespace battles
{
-Battle::Battle(Scenario)
+Battle::Battle(Scenario scenario)
{
+ int team = 0;
+ for (const auto& ships : scenario.teams) {
+ for (const auto& ship : ships) {
+ const auto entity = registry.create();
+ registry.emplace<universe::ShipType>(entity, ship.type);
+ registry.emplace<Team>(entity, team);
+ }
+ team++;
+ }
}