aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Region.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-11-14 22:27:39 +0100
committer hop311 <hop3114@gmail.com>2023-11-15 21:06:16 +0100
commite031758cf68535e97045c07f36e2524676447778 (patch)
treed6e49915c414c86ce808b2e1d7289c7e4e7d76df /src/openvic-simulation/map/Region.cpp
parenta00b558a53edb40c9e6789790036f0b618e80ec1 (diff)
Striped mapmode and improved distributions
Diffstat (limited to 'src/openvic-simulation/map/Region.cpp')
-rw-r--r--src/openvic-simulation/map/Region.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/openvic-simulation/map/Region.cpp b/src/openvic-simulation/map/Region.cpp
index ac232df..e33d9c9 100644
--- a/src/openvic-simulation/map/Region.cpp
+++ b/src/openvic-simulation/map/Region.cpp
@@ -65,18 +65,15 @@ ProvinceSet::provinces_t const& ProvinceSet::get_provinces() const {
return provinces;
}
+static constexpr colour_t ERROR_REGION_COLOUR = COLOUR_COMPONENT << 16;
+
Region::Region(std::string_view new_identifier, provinces_t&& new_provinces, bool new_meta)
- : HasIdentifier { new_identifier }, ProvinceSet { std::move(new_provinces) }, meta { new_meta } {
+ : HasIdentifierAndColour {
+ new_identifier, new_provinces.size() > 0 ? new_provinces.front()->get_colour() : ERROR_REGION_COLOUR, false, false
+ }, ProvinceSet { std::move(new_provinces) }, meta { new_meta } {
lock();
}
bool Region::get_meta() const {
return meta;
}
-
-colour_t Region::get_colour() const {
- if (empty()) {
- return FULL_COLOUR << 16;
- }
- return get_provinces().front()->get_colour();
-}