aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/Region.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-04-08 19:37:30 +0200
committer Hop311 <hop3114@gmail.com>2023-04-08 19:37:30 +0200
commit12d2e458b0c8f0b57b0e42f3dd9fe992e3ebc5b8 (patch)
treec0b0f8494a4b1dec763ee1fa4b53a48e19258ea6 /extension/src/openvic2/Region.cpp
parentd8a747ad3cc643a2320d798646d7c0f74c1babb1 (diff)
Map modes + moved province index image to SIM side
Diffstat (limited to 'extension/src/openvic2/Region.cpp')
-rw-r--r--extension/src/openvic2/Region.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/extension/src/openvic2/Region.cpp b/extension/src/openvic2/Region.cpp
new file mode 100644
index 0000000..6ee05f5
--- /dev/null
+++ b/extension/src/openvic2/Region.cpp
@@ -0,0 +1,26 @@
+#include "Map.hpp"
+
+#include <cassert>
+#include <algorithm>
+
+using namespace OpenVic2;
+
+Region::Region(std::string const& new_identifier) : identifier(new_identifier) {
+ assert(!identifier.empty());
+}
+
+std::string const& Region::get_identifier() const {
+ return identifier;
+}
+
+size_t Region::get_province_count() const {
+ return provinces.size();
+}
+
+bool Region::contains_province(Province const* province) const {
+ return province && std::find(provinces.begin(), provinces.end(), province) != provinces.end();
+}
+
+std::vector<Province*> const& Region::get_provinces() const {
+ return provinces;
+}