aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-11-17 10:19:53 +0100
committer GitHub <noreply@github.com>2023-11-17 10:19:53 +0100
commite76336cd92639f4ec71088fc4c80aea4c25528cd (patch)
treeeeed419a7d97ecb58adf63a17eb9184db3e5ed7a /src/openvic-simulation/map
parenta00b558a53edb40c9e6789790036f0b618e80ec1 (diff)
parent886b8b8f396438fc2b7da7d2508f2064d14150a8 (diff)
Merge pull request #75 from OpenVicProject/accumulated-changes
Accumulated changes
Diffstat (limited to 'src/openvic-simulation/map')
-rw-r--r--src/openvic-simulation/map/Map.cpp52
-rw-r--r--src/openvic-simulation/map/Map.hpp18
-rw-r--r--src/openvic-simulation/map/Province.cpp201
-rw-r--r--src/openvic-simulation/map/Province.hpp87
-rw-r--r--src/openvic-simulation/map/Region.cpp13
-rw-r--r--src/openvic-simulation/map/Region.hpp3
-rw-r--r--src/openvic-simulation/map/TerrainType.hpp2
7 files changed, 171 insertions, 205 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp
index 7e2213e..6df7537 100644
--- a/src/openvic-simulation/map/Map.cpp
+++ b/src/openvic-simulation/map/Map.cpp
@@ -4,6 +4,7 @@
#include <unordered_set>
#include "openvic-simulation/economy/Good.hpp"
+#include "openvic-simulation/history/ProvinceHistory.hpp"
#include "openvic-simulation/utility/BMP.hpp"
#include "openvic-simulation/utility/Logger.hpp"
@@ -24,7 +25,7 @@ Mapmode::index_t Mapmode::get_index() const {
return index;
}
-colour_t Mapmode::get_colour(Map const& map, Province const& province) const {
+Mapmode::base_stripe_t Mapmode::get_base_stripe_colours(Map const& map, Province const& province) const {
return colour_func ? colour_func(map, province) : NULL_COLOUR;
}
@@ -254,15 +255,23 @@ bool Map::generate_mapmode_colours(Mapmode::index_t index, uint8_t* target) cons
mapmode = &Mapmode::ERROR_MAPMODE;
}
// Skip past Province::NULL_INDEX
- for (size_t i = 0; i < MAPMODE_COLOUR_SIZE; ++i) {
+ for (size_t i = 0; i < sizeof(Mapmode::base_stripe_t); ++i) {
*target++ = 0;
}
for (Province const& province : provinces.get_items()) {
- const colour_t colour = mapmode->get_colour(*this, province);
- *target++ = (colour >> 16) & FULL_COLOUR;
- *target++ = (colour >> 8) & FULL_COLOUR;
- *target++ = colour & FULL_COLOUR;
- *target++ = (colour >> 24) & FULL_COLOUR;
+ const Mapmode::base_stripe_t base_stripe = mapmode->get_base_stripe_colours(*this, province);
+ const colour_t base_colour = static_cast<colour_t>(base_stripe);
+ const colour_t stripe_colour = static_cast<colour_t>(base_stripe >> (sizeof(colour_t) * 8));
+
+ *target++ = (base_colour >> 16) & COLOUR_COMPONENT; // red
+ *target++ = (base_colour >> 8) & COLOUR_COMPONENT; // green
+ *target++ = (base_colour >> 0) & COLOUR_COMPONENT; // blue
+ *target++ = (base_colour >> 24) & COLOUR_COMPONENT; // alpha
+
+ *target++ = (stripe_colour >> 16) & COLOUR_COMPONENT; // red
+ *target++ = (stripe_colour >> 8) & COLOUR_COMPONENT; // green
+ *target++ = (stripe_colour >> 0) & COLOUR_COMPONENT; // blue
+ *target++ = (stripe_colour >> 24) & COLOUR_COMPONENT; // alpha
}
return ret;
}
@@ -289,11 +298,25 @@ Pop::pop_size_t Map::get_total_map_population() const {
return total_map_population;
}
-bool Map::setup(BuildingManager const& building_manager, PopManager const& pop_manager) {
+bool Map::reset(BuildingManager const& building_manager) {
+ bool ret = true;
+ for (Province& province : provinces.get_items()) {
+ ret &= province.reset(building_manager);
+ }
+ return ret;
+}
+
+bool Map::apply_history_to_provinces(ProvinceHistoryManager const& history_manager, Date date) {
bool ret = true;
for (Province& province : provinces.get_items()) {
- province.clear_pops();
- ret &= building_manager.generate_province_buildings(province);
+ if (!province.get_water()) {
+ ProvinceHistoryMap const* history_map = history_manager.get_province_history(&province);
+ if (history_map != nullptr) {
+ for (ProvinceHistoryEntry const* entry : history_map->get_entries_up_to(date)) {
+ province.apply_history_to_province(entry);
+ }
+ }
+ }
}
return ret;
}
@@ -489,7 +512,7 @@ bool Map::load_map_images(fs::path const& province_path, fs::path const& terrain
uint8_t const* terrain_data = terrain_bmp.get_pixel_data().data();
std::vector<bool> province_checklist(provinces.size());
- std::vector<decimal_map_t<TerrainType const*>> terrain_type_pixels_list(provinces.size());
+ std::vector<fixed_point_map_t<TerrainType const*>> terrain_type_pixels_list(provinces.size());
bool ret = true;
std::unordered_set<colour_t> unrecognised_province_colours;
@@ -553,9 +576,8 @@ bool Map::load_map_images(fs::path const& province_path, fs::path const& terrain
size_t missing = 0;
for (size_t idx = 0; idx < province_checklist.size(); ++idx) {
Province* province = provinces.get_item_by_index(idx);
- province->_set_terrain_type(
- reinterpret_cast<TerrainType const*>(get_largest_item(terrain_type_pixels_list[idx]).first)
- );
+ const fixed_point_map_const_iterator_t<TerrainType const*> largest = get_largest_item(terrain_type_pixels_list[idx]);
+ province->default_terrain_type = largest != terrain_type_pixels_list[idx].end() ? largest->first : nullptr;
province->on_map = province_checklist[idx];
if (!province->on_map) {
if (detailed_errors) {
@@ -602,6 +624,6 @@ bool Map::_generate_province_adjacencies() {
bool Map::generate_and_load_province_adjacencies(std::vector<ovdl::csv::LineObject> const& additional_adjacencies) {
bool ret = _generate_province_adjacencies();
- // TODO - read additional adjacencies
+ // TODO - DEV TASK: read additional adjacencies
return ret;
}
diff --git a/src/openvic-simulation/map/Map.hpp b/src/openvic-simulation/map/Map.hpp
index d11ad8e..189713c 100644
--- a/src/openvic-simulation/map/Map.hpp
+++ b/src/openvic-simulation/map/Map.hpp
@@ -14,7 +14,10 @@ namespace OpenVic {
struct Mapmode : HasIdentifier {
friend struct Map;
- using colour_func_t = std::function<colour_t(Map const&, Province const&)>;
+ /* Bottom 32 bits are the base colour, top 32 are the stripe colour, both in ARGB format with the alpha channels
+ * controlling interpolation with the terrain colour (0 = all terrain, 255 = all corresponding RGB) */
+ using base_stripe_t = uint64_t;
+ using colour_func_t = std::function<base_stripe_t(Map const&, Province const&)>;
using index_t = size_t;
private:
@@ -29,10 +32,11 @@ namespace OpenVic {
Mapmode(Mapmode&&) = default;
index_t get_index() const;
- colour_t get_colour(Map const& map, Province const& province) const;
+ base_stripe_t get_base_stripe_colours(Map const& map, Province const& province) const;
};
struct GoodManager;
+ struct ProvinceHistoryManager;
/* REQUIREMENTS:
* MAP-4
@@ -98,10 +102,16 @@ namespace OpenVic {
bool add_mapmode(std::string_view identifier, Mapmode::colour_func_t colour_func);
IDENTIFIER_REGISTRY_ACCESSORS(mapmode)
Mapmode const* get_mapmode_by_index(size_t index) const;
- static constexpr size_t MAPMODE_COLOUR_SIZE = 4;
+
+ /* The mapmode colour image contains of a list of base colours and stripe colours. Each colour is four bytes
+ * in RGBA format, with the alpha value being used to interpolate with the terrain colour, so A = 0 is fully terrain
+ * and A = 255 is fully the RGB colour packaged with A. The base and stripe colours for each province are packed
+ * together adjacently, so each province's entry is 8 bytes long. The list contains Province::MAX_INDEX + 1 entries,
+ * that is the maximum allowed number of provinces plus one for the index-zero "null province". */
bool generate_mapmode_colours(Mapmode::index_t index, uint8_t* target) const;
- bool setup(BuildingManager const& building_manager, PopManager const& pop_manager);
+ bool reset(BuildingManager const& building_manager);
+ bool apply_history_to_provinces(ProvinceHistoryManager const& history_manager, Date date);
void update_highest_province_population();
Pop::pop_size_t get_highest_province_population() const;
diff --git a/src/openvic-simulation/map/Province.cpp b/src/openvic-simulation/map/Province.cpp
index 4b76210..c2d2da0 100644
--- a/src/openvic-simulation/map/Province.cpp
+++ b/src/openvic-simulation/map/Province.cpp
@@ -8,56 +8,16 @@ using namespace OpenVic::NodeTools;
Province::Province(
std::string_view new_identifier, colour_t new_colour, index_t new_index
) : HasIdentifierAndColour { new_identifier, new_colour, true, false }, index { new_index },
- buildings { "buildings", false } {
+ region { nullptr }, on_map { false }, has_region { false }, water { false }, default_terrain_type { nullptr },
+ terrain_type { nullptr }, life_rating { 0 }, colony_status { colony_status_t::STATE }, owner { nullptr },
+ controller { nullptr }, slave { false }, buildings { "buildings", false }, rgo { nullptr }, total_population { 0 } {
assert(index != NULL_INDEX);
}
-Province::index_t Province::get_index() const {
- return index;
-}
-
-Region* Province::get_region() const {
- return region;
-}
-
-bool Province::get_on_map() const {
- return on_map;
-}
-
-bool Province::get_has_region() const {
- return has_region;
-}
-
-bool Province::get_water() const {
- return water;
-}
-
-TerrainType const* Province::get_terrain_type() const {
- return terrain_type;
-}
-
-Province::life_rating_t Province::get_life_rating() const {
- return life_rating;
-}
-
-Province::colony_status_t Province::get_colony_status() const {
- return colony_status;
-}
-
-Country const* Province::get_owner() const {
- return owner;
-}
-
-Country const* Province::get_controller() const {
- return controller;
-}
-
-std::vector<Country const*> const& Province::get_cores() const {
- return cores;
-}
-
-bool Province::is_slave() const {
- return slave;
+std::string Province::to_string() const {
+ std::stringstream stream;
+ stream << "(#" << std::to_string(index) << ", " << get_identifier() << ", 0x" << colour_to_hex_string() << ")";
+ return stream.str();
}
bool Province::load_positions(BuildingManager const& building_manager, ast::NodeCPtr root) {
@@ -89,14 +49,6 @@ bool Province::load_positions(BuildingManager const& building_manager, ast::Node
)(root);
}
-bool Province::add_building(BuildingInstance&& building_instance) {
- return buildings.add_item(std::move(building_instance));
-}
-
-void Province::reset_buildings() {
- buildings.reset();
-}
-
bool Province::expand_building(std::string_view building_type_identifier) {
BuildingInstance* building = buildings.get_item_by_identifier(building_type_identifier);
if (building == nullptr) {
@@ -105,16 +57,6 @@ bool Province::expand_building(std::string_view building_type_identifier) {
return building->expand();
}
-Good const* Province::get_rgo() const {
- return rgo;
-}
-
-std::string Province::to_string() const {
- std::stringstream stream;
- stream << "(#" << std::to_string(index) << ", " << get_identifier() << ", 0x" << colour_to_hex_string() << ")";
- return stream.str();
-}
-
bool Province::load_pop_list(PopManager const& pop_manager, ast::NodeCPtr root) {
return expect_dictionary_reserve_length(pops,
[this, &pop_manager](std::string_view pop_type_identifier, ast::NodeCPtr pop_node) -> bool {
@@ -133,22 +75,10 @@ bool Province::add_pop(Pop&& pop) {
}
}
-void Province::clear_pops() {
- pops.clear();
-}
-
size_t Province::get_pop_count() const {
return pops.size();
}
-std::vector<Pop> const& Province::get_pops() const {
- return pops;
-}
-
-Pop::pop_size_t Province::get_total_population() const {
- return total_population;
-}
-
/* REQUIREMENTS:
* MAP-65, MAP-68, MAP-70, MAP-234
*/
@@ -185,14 +115,6 @@ Province::adjacency_t::adjacency_t(Province const* province, distance_t distance
assert(province != nullptr);
}
-Province::distance_t Province::adjacency_t::get_distance() const {
- return distance;
-}
-
-Province::flags_t Province::adjacency_t::get_flags() const {
- return flags;
-}
-
bool Province::is_adjacent_to(Province const* province) {
for (adjacency_t adj : adjacencies) {
if (adj.province == province) {
@@ -207,7 +129,6 @@ bool Province::add_adjacency(Province const* province, distance_t distance, flag
Logger::error("Tried to create null adjacency province for province ", get_identifier(), "!");
return false;
}
-
if (is_adjacent_to(province)) {
return false;
}
@@ -215,46 +136,84 @@ bool Province::add_adjacency(Province const* province, distance_t distance, flag
return true;
}
-std::vector<Province::adjacency_t> const& Province::get_adjacencies() const {
- return adjacencies;
-}
+bool Province::reset(BuildingManager const& building_manager) {
+ terrain_type = default_terrain_type;
+ life_rating = 0;
+ colony_status = colony_status_t::STATE;
+ owner = nullptr;
+ controller = nullptr;
+ cores.clear();
+ slave = false;
+ rgo = nullptr;
-void Province::_set_terrain_type(TerrainType const* type) {
- terrain_type = type;
-}
+ buildings.reset();
+ bool ret = true;
+ if (!get_water()) {
+ if (building_manager.building_types_are_locked()) {
+ for (BuildingType const& building_type : building_manager.get_building_types()) {
+ if (building_type.get_in_province()) {
+ ret &= buildings.add_item({ building_type });
+ }
+ }
+ } else {
+ Logger::error("Cannot generate buildings until building types are locked!");
+ ret = false;
+ }
+ }
+ lock_buildings();
+
+ pops.clear();
+ update_pops();
-void Province::apply_history_to_province(ProvinceHistoryMap const& history, Date date) {
- auto entries = history.get_entries(date);
-
- reset_buildings();
+ return ret;
+}
- for (ProvinceHistoryEntry const* entry : entries) {
- if (entry->get_life_rating()) life_rating = *entry->get_life_rating();
- if (entry->get_colonial()) colony_status = *entry->get_colonial();
- if (entry->get_rgo()) rgo = *entry->get_rgo();
- if (entry->get_terrain_type()) terrain_type = *entry->get_terrain_type();
- if (entry->get_owner()) owner = *entry->get_owner();
- if (entry->get_controller()) controller = *entry->get_controller();
- if (entry->get_slave()) slave = *entry->get_slave();
- for (const auto& core : entry->get_remove_cores()) {
- const auto existing_core = std::find(cores.begin(), cores.end(), core);
- if (existing_core != cores.end()) cores.erase(existing_core);
+bool Province::apply_history_to_province(ProvinceHistoryEntry const* entry) {
+ if (entry == nullptr) {
+ Logger::error("Trying to apply null province history to ", get_identifier());
+ return false;
+ }
+ if (entry->get_life_rating()) life_rating = *entry->get_life_rating();
+ if (entry->get_colonial()) colony_status = *entry->get_colonial();
+ if (entry->get_rgo()) rgo = *entry->get_rgo();
+ if (entry->get_terrain_type()) terrain_type = *entry->get_terrain_type();
+ if (entry->get_owner()) owner = *entry->get_owner();
+ if (entry->get_controller()) controller = *entry->get_controller();
+ if (entry->get_slave()) slave = *entry->get_slave();
+ for (Country const* core : entry->get_remove_cores()) {
+ const typename decltype(cores)::iterator existing_core = std::find(cores.begin(), cores.end(), core);
+ if (existing_core != cores.end()) {
+ cores.erase(existing_core);
+ } else {
+ Logger::warning(
+ "Trying to remove non-existent core ", core->get_identifier(), " from province ", get_identifier()
+ );
}
- for (const auto& core : entry->get_add_cores()) {
- const auto existing_core = std::find(cores.begin(), cores.end(), core);
- if (existing_core == cores.end()) cores.push_back(core);
+ }
+ for (Country const* core : entry->get_add_cores()) {
+ const typename decltype(cores)::iterator existing_core = std::find(cores.begin(), cores.end(), core);
+ if (existing_core == cores.end()) {
+ cores.push_back(core);
+ } else {
+ Logger::warning(
+ "Trying to add already-existing core ", core->get_identifier(), " to province ", get_identifier()
+ );
}
- // TODO: rework province buildings
- for (const auto& building : entry->get_buildings()) {
- BuildingInstance* existing_entry = buildings.get_item_by_identifier(building.first->get_identifier());
- if (existing_entry != nullptr) {
- existing_entry->set_level(building.second);
- } else {
- BuildingInstance instance = { *building.first };
- instance.set_level(building.second);
- add_building(std::move(instance));
- }
+ }
+ bool ret = true;
+ for (auto const& [building, level] : entry->get_province_buildings()) {
+ BuildingInstance* existing_entry = buildings.get_item_by_identifier(building->get_identifier());
+ if (existing_entry != nullptr) {
+ existing_entry->set_level(level);
+ } else {
+ Logger::error(
+ "Trying to set level of non-existent province building ", building->get_identifier(), " to ", level,
+ " in province ", get_identifier()
+ );
+ ret = false;
}
- // TODO: party loyalties for each POP when implemented on POP side
}
+ // TODO: load state buildings
+ // TODO: party loyalties for each POP when implemented on POP side#
+ return ret;
}
diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp
index eda05fb..af0bed4 100644
--- a/src/openvic-simulation/map/Province.hpp
+++ b/src/openvic-simulation/map/Province.hpp
@@ -2,7 +2,7 @@
#include <cassert>
-#include "openvic-simulation/economy/Building.hpp"
+#include "openvic-simulation/economy/BuildingInstance.hpp"
#include "openvic-simulation/politics/Ideology.hpp"
#include "openvic-simulation/pop/Pop.hpp"
#include "openvic-simulation/country/Country.hpp"
@@ -13,7 +13,7 @@ namespace OpenVic {
struct Good;
struct TerrainType;
struct TerrainTypeMapping;
- struct ProvinceHistoryMap;
+ struct ProvinceHistoryEntry;
/* REQUIREMENTS:
* MAP-5, MAP-7, MAP-8, MAP-43, MAP-47
@@ -34,14 +34,10 @@ namespace OpenVic {
private:
Province const* const province;
- const distance_t distance;
- flags_t flags;
+ const distance_t PROPERTY(distance);
+ flags_t PROPERTY(flags);
adjacency_t(Province const* province, distance_t distance, flags_t flags);
-
- public:
- distance_t get_distance() const;
- flags_t get_flags() const;
};
struct province_positions_t {
@@ -64,62 +60,50 @@ namespace OpenVic {
static constexpr index_t NULL_INDEX = 0, MAX_INDEX = std::numeric_limits<index_t>::max();
private:
- const index_t index;
- Region* region = nullptr;
- bool on_map = false, has_region = false, water = false;
- life_rating_t life_rating = 0;
- colony_status_t colony_status = colony_status_t::STATE;
- IdentifierRegistry<BuildingInstance> buildings;
- // TODO - change this into a factory-like structure
- Good const* rgo = nullptr;
-
- std::vector<Pop> pops;
- Pop::pop_size_t total_population;
- decimal_map_t<PopType const*> PROPERTY(pop_type_distribution);
- decimal_map_t<Ideology const*> PROPERTY(ideology_distribution);
- decimal_map_t<Culture const*> PROPERTY(culture_distribution);
- decimal_map_t<Religion const*> PROPERTY(religion_distribution);
-
- std::vector<adjacency_t> adjacencies;
+ const index_t PROPERTY(index);
+ Region* PROPERTY(region);
+ bool PROPERTY(on_map);
+ bool PROPERTY(has_region);
+ bool PROPERTY(water);
+ /* Terrain type calculated from terrain image */
+ TerrainType const* PROPERTY(default_terrain_type);
+
+ std::vector<adjacency_t> PROPERTY(adjacencies);
province_positions_t positions;
- TerrainType const* terrain_type = nullptr;
-
- void _set_terrain_type(TerrainType const* type);
+ TerrainType const* PROPERTY(terrain_type);
+ life_rating_t PROPERTY(life_rating);
+ colony_status_t PROPERTY(colony_status);
+ Country const* PROPERTY(owner);
+ Country const* PROPERTY(controller);
+ std::vector<Country const*> PROPERTY(cores);
+ bool PROPERTY(slave);
+ // TODO - change this into a factory-like structure
+ Good const* PROPERTY(rgo);
+ IdentifierRegistry<BuildingInstance> buildings;
- Country const* owner = nullptr;
- Country const* controller = nullptr;
- std::vector<Country const*> cores;
- bool slave = false;
+ std::vector<Pop> PROPERTY(pops);
+ Pop::pop_size_t PROPERTY(total_population);
+ fixed_point_map_t<PopType const*> PROPERTY(pop_type_distribution);
+ fixed_point_map_t<Ideology const*> PROPERTY(ideology_distribution);
+ fixed_point_map_t<Culture const*> PROPERTY(culture_distribution);
+ fixed_point_map_t<Religion const*> PROPERTY(religion_distribution);
Province(std::string_view new_identifier, colour_t new_colour, index_t new_index);
public:
Province(Province&&) = default;
- index_t get_index() const;
- Region* get_region() const;
- bool get_on_map() const;
- bool get_has_region() const;
- bool get_water() const;
- TerrainType const* get_terrain_type() const;
- life_rating_t get_life_rating() const;
- colony_status_t get_colony_status() const;
+ std::string to_string() const;
+
bool load_positions(BuildingManager const& building_manager, ast::NodeCPtr root);
- bool add_building(BuildingInstance&& building_instance);
IDENTIFIER_REGISTRY_ACCESSORS(building)
- void reset_buildings();
bool expand_building(std::string_view building_type_identifier);
- Good const* get_rgo() const;
- std::string to_string() const;
bool load_pop_list(PopManager const& pop_manager, ast::NodeCPtr root);
bool add_pop(Pop&& pop);
- void clear_pops();
size_t get_pop_count() const;
- std::vector<Pop> const& get_pops() const;
- Pop::pop_size_t get_total_population() const;
void update_pops();
void update_state(Date today);
@@ -127,13 +111,8 @@ namespace OpenVic {
bool is_adjacent_to(Province const* province);
bool add_adjacency(Province const* province, distance_t distance, flags_t flags);
- std::vector<adjacency_t> const& get_adjacencies() const;
-
- Country const* get_owner() const;
- Country const* get_controller() const;
- std::vector<Country const*> const& get_cores() const;
- bool is_slave() const;
- void apply_history_to_province(ProvinceHistoryMap const& history, Date date);
+ bool reset(BuildingManager const& building_manager);
+ bool apply_history_to_province(ProvinceHistoryEntry const* entry);
};
}
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();
-}
diff --git a/src/openvic-simulation/map/Region.hpp b/src/openvic-simulation/map/Region.hpp
index 157b643..9119b93 100644
--- a/src/openvic-simulation/map/Region.hpp
+++ b/src/openvic-simulation/map/Region.hpp
@@ -28,7 +28,7 @@ namespace OpenVic {
/* REQUIREMENTS:
* MAP-6, MAP-44, MAP-48
*/
- struct Region : HasIdentifier, ProvinceSet {
+ struct Region : HasIdentifierAndColour, ProvinceSet {
friend struct Map;
private:
@@ -44,6 +44,5 @@ namespace OpenVic {
Region(Region&&) = default;
bool get_meta() const;
- colour_t get_colour() const;
};
}
diff --git a/src/openvic-simulation/map/TerrainType.hpp b/src/openvic-simulation/map/TerrainType.hpp
index 656c938..92f78dd 100644
--- a/src/openvic-simulation/map/TerrainType.hpp
+++ b/src/openvic-simulation/map/TerrainType.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "openvic-simulation/Modifier.hpp"
+#include "openvic-simulation/misc/Modifier.hpp"
namespace OpenVic {
struct TerrainTypeManager;