aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/InstanceManager.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-23 19:47:47 +0200
committer GitHub <noreply@github.com>2024-07-23 19:47:47 +0200
commit6cd55c452d1643666ff4169a89402fd3e3b66c61 (patch)
tree888b847a54c66b6e9d1b2f7ee3e3d0f8071eceda /src/openvic-simulation/InstanceManager.cpp
parent9d57ca273e4b32ab82a51789ec58e08fefb5276a (diff)
parent67cbd14630c4344902d3fa1ddca178809da4293b (diff)
Merge pull request #177 from OpenVicProject/country-instance
Fleshing out Country, State and Province instances + history
Diffstat (limited to 'src/openvic-simulation/InstanceManager.cpp')
-rw-r--r--src/openvic-simulation/InstanceManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/openvic-simulation/InstanceManager.cpp b/src/openvic-simulation/InstanceManager.cpp
index d314acd..cd5da59 100644
--- a/src/openvic-simulation/InstanceManager.cpp
+++ b/src/openvic-simulation/InstanceManager.cpp
@@ -41,6 +41,7 @@ void InstanceManager::update_gamestate() {
// Update gamestate...
map_instance.update_gamestate(today);
+ country_instance_manager.update_gamestate();
gamestate_updated();
gamestate_needs_update = false;
@@ -74,12 +75,12 @@ bool InstanceManager::setup() {
definition_manager.get_pop_manager().get_pop_types(),
definition_manager.get_politics_manager().get_ideology_manager().get_ideologies()
);
- ret &= map_instance.get_state_manager().generate_states(map_instance);
ret &= country_instance_manager.generate_country_instances(
definition_manager.get_country_definition_manager(),
definition_manager.get_research_manager().get_technology_manager().get_technologies(),
definition_manager.get_research_manager().get_invention_manager().get_inventions(),
- definition_manager.get_politics_manager().get_ideology_manager().get_ideologies()
+ definition_manager.get_politics_manager().get_ideology_manager().get_ideologies(),
+ definition_manager.get_pop_manager().get_pop_types()
);
game_instance_setup = true;
@@ -115,6 +116,7 @@ bool InstanceManager::load_bookmark(Bookmark const* new_bookmark) {
bool ret = map_instance.apply_history_to_provinces(
definition_manager.get_history_manager().get_province_manager(), today,
+ country_instance_manager,
// TODO - the following argument is for generating test pop attributes
definition_manager.get_politics_manager().get_issue_manager()
);
@@ -123,6 +125,10 @@ bool InstanceManager::load_bookmark(Bookmark const* new_bookmark) {
definition_manager.get_history_manager().get_country_manager(), today, unit_instance_manager, map_instance
);
+ ret &= map_instance.get_state_manager().generate_states(
+ map_instance, definition_manager.get_pop_manager().get_pop_types()
+ );
+
return ret;
}