From 13e4f3e3908220d484b01b9fb6dc4375ab28a16e Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 3 Dec 2022 01:01:39 +0100 Subject: Extracted Scenario and related things into own campaign module --- campaign/src/Scenario.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 campaign/src/Scenario.cpp (limited to 'campaign/src/Scenario.cpp') 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 + + +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 -- cgit v1.1