aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-04-15 00:29:28 +0200
committer hop311 <hop3114@gmail.com>2024-04-15 00:38:46 +0200
commit5799836bee29024ce8a2d0fc45e06664c0110751 (patch)
tree54a0ad26ef3cec9a56644479611e8abaad62b1f7 /src/openvic-simulation/GameManager.cpp
parent109d31f147512c8d51f35f9773cd3c6bb1b8b994 (diff)
Generate starting unit instancesunits
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r--src/openvic-simulation/GameManager.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp
index bb807c9..94d9c62 100644
--- a/src/openvic-simulation/GameManager.cpp
+++ b/src/openvic-simulation/GameManager.cpp
@@ -54,21 +54,33 @@ bool GameManager::reset() {
bool GameManager::load_bookmark(Bookmark const* new_bookmark) {
bool ret = reset();
+
bookmark = new_bookmark;
if (bookmark == nullptr) {
+ Logger::error("Cannot load bookmark - null!");
return ret;
}
+
Logger::info("Loading bookmark ", bookmark->get_name(), " with start date ", bookmark->get_date());
+
if (!define_manager.in_game_period(bookmark->get_date())) {
Logger::warning("Bookmark date ", bookmark->get_date(), " is not in the game's time period!");
}
+
today = bookmark->get_date();
+
ret &= map.apply_history_to_provinces(
history_manager.get_province_manager(), today, politics_manager.get_ideology_manager(),
politics_manager.get_issue_manager(), *country_manager.get_country_by_identifier("ENG")
);
+
map.get_state_manager().generate_states(map);
- // TODO - apply country history
+
+ ret &= country_instance_manager.generate_country_instances(country_manager);
+ ret &= country_instance_manager.apply_history_to_countries(
+ history_manager.get_country_manager(), today, military_manager.get_unit_instance_manager(), map
+ );
+
return ret;
}