aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-28 16:16:41 +0100
committer hop311 <hop3114@gmail.com>2023-12-28 16:16:41 +0100
commit12a47833bbe72d50271bde15c7579c1e801863c2 (patch)
tree8f67577b0101c06e2a7cc4d4c277d686d16d3d75 /src/openvic-simulation/map
parent56a865d7d0868b785eb6b9b723f0e52f65e6457d (diff)
Clock refactor + misc small fixes
Diffstat (limited to 'src/openvic-simulation/map')
-rw-r--r--src/openvic-simulation/map/Map.cpp9
-rw-r--r--src/openvic-simulation/map/Map.hpp2
-rw-r--r--src/openvic-simulation/map/Province.cpp4
-rw-r--r--src/openvic-simulation/map/Province.hpp3
4 files changed, 10 insertions, 8 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp
index 67e91cd..39d4870 100644
--- a/src/openvic-simulation/map/Map.cpp
+++ b/src/openvic-simulation/map/Map.cpp
@@ -286,9 +286,9 @@ bool Map::apply_history_to_provinces(ProvinceHistoryManager const& history_manag
return ret;
}
-void Map::update_state(Date today) {
+void Map::update_gamestate(Date today) {
for (Province& province : provinces.get_items()) {
- province.update_state(today);
+ province.update_gamestate(today);
}
update_highest_province_population();
update_total_map_population();
@@ -684,11 +684,14 @@ bool Map::load_climate_file(ModifierManager const& modifier_manager, ast::NodeCP
return true;
}
))(node);
- cur_climate->lock();
}
return ret;
})(root);
+ for (Climate& climate : climates.get_items()) {
+ climate.lock();
+ }
+
lock_climates();
return ret;
diff --git a/src/openvic-simulation/map/Map.hpp b/src/openvic-simulation/map/Map.hpp
index 2575324..0025cf4 100644
--- a/src/openvic-simulation/map/Map.hpp
+++ b/src/openvic-simulation/map/Map.hpp
@@ -124,7 +124,7 @@ namespace OpenVic {
void update_highest_province_population();
void update_total_map_population();
- void update_state(Date today);
+ void update_gamestate(Date today);
void tick(Date today);
bool load_province_definitions(std::vector<ovdl::csv::LineObject> const& lines);
diff --git a/src/openvic-simulation/map/Province.cpp b/src/openvic-simulation/map/Province.cpp
index 2d301e8..1285b0d 100644
--- a/src/openvic-simulation/map/Province.cpp
+++ b/src/openvic-simulation/map/Province.cpp
@@ -112,9 +112,9 @@ void Province::update_pops() {
}
}
-void Province::update_state(Date today) {
+void Province::update_gamestate(Date today) {
for (BuildingInstance& building : buildings.get_items()) {
- building.update_state(today);
+ building.update_gamestate(today);
}
update_pops();
}
diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp
index 431b4c2..7a42666 100644
--- a/src/openvic-simulation/map/Province.hpp
+++ b/src/openvic-simulation/map/Province.hpp
@@ -20,7 +20,6 @@ namespace OpenVic {
using Climate = ProvinceSetModifier;
using Continent = ProvinceSetModifier;
-
/* REQUIREMENTS:
* MAP-5, MAP-7, MAP-8, MAP-43, MAP-47
* POP-22
@@ -143,7 +142,7 @@ namespace OpenVic {
size_t get_pop_count() const;
void update_pops();
- void update_state(Date today);
+ void update_gamestate(Date today);
void tick(Date today);
private: