summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-12-23 01:44:01 +0100
committerAki <please@ignore.pl>2022-12-23 01:44:01 +0100
commit5d9f9534b0be98c73b2d602f3195eff6c8b56985 (patch)
treed0602d860ff595d790dbeab6fb2c72343050fa44
parent76f0c4a9c7171fb223d0a793197b2dcce0f8819c (diff)
downloadkurator-5d9f9534b0be98c73b2d602f3195eff6c8b56985.zip
kurator-5d9f9534b0be98c73b2d602f3195eff6c8b56985.tar.gz
kurator-5d9f9534b0be98c73b2d602f3195eff6c8b56985.tar.bz2
Moved sample scenario creation to a loop
-rw-r--r--campaign/src/scenarios.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/campaign/src/scenarios.cpp b/campaign/src/scenarios.cpp
index 9f4222b..de57971 100644
--- a/campaign/src/scenarios.cpp
+++ b/campaign/src/scenarios.cpp
@@ -1,6 +1,7 @@
#include <kurator/campaign/scenarios.h>
#include <kurator/campaign/Scenario.h>
+#include <kurator/campaign/ShipConfig.h>
namespace kurator
@@ -15,28 +16,16 @@ Scenario
example()
{
int id = 0;
- return {
- "Example",
- 12000,
- {
- {{id++}, 0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 0, "Warbringer", {"ChargeLaser"}},
- {{id++}, 0, "Warbringer", {"ChargeLaser"}},
- {{id++}, 0, "Eclipse", {"ChargeLaser"}},
- {{id++}, 0, "Eclipse", {"ChargeLaser"}},
- {{id++}, 0, "Eclipse", {"ChargeLaser"}},
- {{id++}, 1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
- {{id++}, 1, "Warbringer", {"ChargeLaser"}},
- {{id++}, 1, "Warbringer", {"ChargeLaser"}},
- {{id++}, 1, "Eclipse", {"ChargeLaser"}},
- {{id++}, 1, "Eclipse", {"ChargeLaser"}},
- {{id++}, 1, "Eclipse", {"ChargeLaser"}},
- },
- };
+ Scenario scenario {"Example", 12000, {}};
+ for (int team = 0; team < 2; ++team) {
+ for (int i = 0; i < 2; ++i)
+ scenario.ships.push_back(ShipConfig{{id++}, team, "Anvil", {"ChargeLaser", "ChargeLaser"}});
+ for (int i = 0; i < 3; ++i)
+ scenario.ships.push_back(ShipConfig{{id++}, team, "Warbringer", {"ChargeLaser"}});
+ for (int i = 0; i < 5; ++i)
+ scenario.ships.push_back(ShipConfig{{id++}, team, "Eclipse", {"ChargeLaser"}});
+ }
+ return scenario;
}