aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Map.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-10-13 10:16:44 +0200
committer GitHub <noreply@github.com>2023-10-13 10:16:44 +0200
commit32fdf7c38b2e56339a2fffa71a7a61a854759e2c (patch)
tree4ad745778dea488ad10509cf17d349c3ef0cc229 /src/openvic-simulation/map/Map.cpp
parentbb22324da1225a0ac458c1d69893bb3bd28bd6b7 (diff)
parentd95c3c9da75018e3e959e5493ebd9c520e00bf7a (diff)
Merge pull request #50 from OpenVicProject/changes
Lots of accumulated changes
Diffstat (limited to 'src/openvic-simulation/map/Map.cpp')
-rw-r--r--src/openvic-simulation/map/Map.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp
index 386e7be..acd882e 100644
--- a/src/openvic-simulation/map/Map.cpp
+++ b/src/openvic-simulation/map/Map.cpp
@@ -78,11 +78,16 @@ bool Map::set_water_province(std::string_view identifier) {
}
bool Map::set_water_province_list(std::vector<std::string_view> const& list) {
+ if (water_provinces.is_locked()) {
+ Logger::error("The map's water provinces have already been locked!");
+ return false;
+ }
bool ret = true;
water_provinces.reserve(water_provinces.size() + list.size());
for (std::string_view const& identifier : list) {
ret &= set_water_province(identifier);
}
+ lock_water_provinces();
return ret;
}
@@ -271,7 +276,7 @@ Pop::pop_size_t Map::get_total_map_population() const {
return total_map_population;
}
-bool Map::setup(GoodManager const& good_manager, BuildingManager const& building_manager, PopManager const& pop_manager) {
+bool Map::setup(BuildingManager const& building_manager, PopManager const& pop_manager) {
bool ret = true;
for (Province& province : provinces.get_items()) {
province.clear_pops();