summaryrefslogtreecommitdiff
path: root/campaign/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-12-03 01:01:39 +0100
committerAki <please@ignore.pl>2022-12-03 01:01:39 +0100
commit13e4f3e3908220d484b01b9fb6dc4375ab28a16e (patch)
treee35ecc703948ad0dea4a63260ab621cd95c229b4 /campaign/src
parent2f7d5c306430d65d18eac184551bac8937877d49 (diff)
downloadkurator-13e4f3e3908220d484b01b9fb6dc4375ab28a16e.zip
kurator-13e4f3e3908220d484b01b9fb6dc4375ab28a16e.tar.gz
kurator-13e4f3e3908220d484b01b9fb6dc4375ab28a16e.tar.bz2
Extracted Scenario and related things into own campaign module
Diffstat (limited to 'campaign/src')
-rw-r--r--campaign/src/Scenario.cpp23
-rw-r--r--campaign/src/scenarios.cpp43
2 files changed, 66 insertions, 0 deletions
diff --git a/campaign/src/Scenario.cpp b/campaign/src/Scenario.cpp
new file mode 100644
index 0000000..cd5a1c6
--- /dev/null
+++ b/campaign/src/Scenario.cpp
@@ -0,0 +1,23 @@
+#include <kurator/campaign/Scenario.h>
+
+
+namespace kurator
+{
+namespace campaign
+{
+
+
+int
+Scenario::total_teams() const
+{
+ int last_team = 0;
+ for (const auto& ship : ships) {
+ if (ship.team > last_team)
+ last_team = ship.team;
+ }
+ return last_team + 1;
+}
+
+
+} // namespace campaign
+} // namespace kurator
diff --git a/campaign/src/scenarios.cpp b/campaign/src/scenarios.cpp
new file mode 100644
index 0000000..06b4659
--- /dev/null
+++ b/campaign/src/scenarios.cpp
@@ -0,0 +1,43 @@
+#include <kurator/campaign/scenarios.h>
+
+#include <kurator/campaign/Scenario.h>
+
+
+namespace kurator
+{
+namespace campaign
+{
+namespace scenarios
+{
+
+
+Scenario
+example()
+{
+ return {
+ "Example",
+ {
+ {0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {0, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {0, "Warbringer", {"ChargeLaser"}},
+ {0, "Warbringer", {"ChargeLaser"}},
+ {0, "Eclipse", {"ChargeLaser"}},
+ {0, "Eclipse", {"ChargeLaser"}},
+ {0, "Eclipse", {"ChargeLaser"}},
+ {1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {1, "Anvil", {"ChargeLaser", "ChargeLaser"}},
+ {1, "Warbringer", {"ChargeLaser"}},
+ {1, "Warbringer", {"ChargeLaser"}},
+ {1, "Eclipse", {"ChargeLaser"}},
+ {1, "Eclipse", {"ChargeLaser"}},
+ {1, "Eclipse", {"ChargeLaser"}},
+ },
+ };
+}
+
+
+} // namespace scenarios
+} // namespace campaign
+} // namespace kurator