aboutsummaryrefslogtreecommitdiff
path: root/src/openvic2/map/Region.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-05-03 20:37:26 +0200
committer Hop311 <hop3114@gmail.com>2023-05-03 20:37:26 +0200
commit64bbf86b623a3cca2eaf9009d7acdcde067592e3 (patch)
tree5d607f28019675c9eaaa2883acf036717fa45b2f /src/openvic2/map/Region.cpp
parentc92481448159d3a363d6a99b3025bd2358c3dab6 (diff)
Moved code to src/openvic2
Diffstat (limited to 'src/openvic2/map/Region.cpp')
-rw-r--r--src/openvic2/map/Region.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/openvic2/map/Region.cpp b/src/openvic2/map/Region.cpp
new file mode 100644
index 0000000..da0dfdd
--- /dev/null
+++ b/src/openvic2/map/Region.cpp
@@ -0,0 +1,24 @@
+#include "Region.hpp"
+
+#include <cassert>
+
+using namespace OpenVic2;
+
+size_t ProvinceSet::get_province_count() const {
+ return provinces.size();
+}
+
+bool ProvinceSet::contains_province(Province const* province) const {
+ return province && std::find(provinces.begin(), provinces.end(), province) != provinces.end();
+}
+
+std::set<Province*> const& ProvinceSet::get_provinces() const {
+ return provinces;
+}
+
+Region::Region(std::string const& new_identifier) : HasIdentifier{ new_identifier } {}
+
+colour_t Region::get_colour() const {
+ if (provinces.empty()) return 0xFF0000;
+ return (*provinces.cbegin())->get_colour();
+}