aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Region.hpp
diff options
context:
space:
mode:
author Steve Frampton <40193522+FarmingtonS9@users.noreply.github.com>2023-09-16 01:15:33 +0200
committer GitHub <noreply@github.com>2023-09-16 01:15:33 +0200
commit879b9debfb97c48ed46d777b2a99d71757658cc6 (patch)
tree87974e84563d08c2f2762b75da0cfb2b4e28eab2 /src/openvic-simulation/map/Region.hpp
parent6278a35f4704574933464700026d8deb997da5c1 (diff)
parent8cf93b6523dc380ef0c7215e15e327a78bf4578e (diff)
Merge pull request #15 from OpenVicProject/more-dataloading
More dataloading
Diffstat (limited to 'src/openvic-simulation/map/Region.hpp')
-rw-r--r--src/openvic-simulation/map/Region.hpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/Region.hpp b/src/openvic-simulation/map/Region.hpp
index 2fccf06..d68033b 100644
--- a/src/openvic-simulation/map/Region.hpp
+++ b/src/openvic-simulation/map/Region.hpp
@@ -5,11 +5,15 @@
namespace OpenVic {
struct ProvinceSet {
- protected:
- std::vector<Province*> provinces;
+ using provinces_t = std::vector<Province*>;
+
+ private:
+ provinces_t provinces;
bool locked = false;
public:
+ ProvinceSet(provinces_t&& new_provinces = {});
+
bool add_province(Province* province);
void lock(bool log = false);
bool is_locked() const;
@@ -18,7 +22,7 @@ namespace OpenVic {
size_t size() const;
void reserve(size_t size);
bool contains_province(Province const* province) const;
- std::vector<Province*> const& get_provinces() const;
+ provinces_t const& get_provinces() const;
};
/* REQUIREMENTS:
@@ -28,11 +32,18 @@ namespace OpenVic {
friend struct Map;
private:
- Region(const std::string_view new_identifier);
+ /* A meta region cannot be the template for a state.
+ * Any region containing a province already listed in a
+ * previously defined region is considered a meta region.
+ */
+ const bool meta;
+
+ Region(const std::string_view new_identifier, provinces_t&& new_provinces, bool new_meta);
public:
Region(Region&&) = default;
+ bool get_meta() const;
colour_t get_colour() const;
};
}