diff options
author | hop311 <hop3114@gmail.com> | 2024-09-06 22:12:10 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-09-06 22:12:10 +0200 |
commit | 34c8b1039a5a7982a84c718ca8625efcd940bbf5 (patch) | |
tree | 479bddfb6a01b2627118ee2b71adea4105fe8718 /src/openvic-simulation/InstanceManager.cpp | |
parent | 429765a8cdc93cc8975d2676d04cb628c21064a4 (diff) |
Trigger gamestate update in headless mode + add `update_clock` functionsupdate-clock
Diffstat (limited to 'src/openvic-simulation/InstanceManager.cpp')
-rw-r--r-- | src/openvic-simulation/InstanceManager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/openvic-simulation/InstanceManager.cpp b/src/openvic-simulation/InstanceManager.cpp index 1df6e90..ea30246 100644 --- a/src/openvic-simulation/InstanceManager.cpp +++ b/src/openvic-simulation/InstanceManager.cpp @@ -148,6 +148,16 @@ bool InstanceManager::start_game_session() { return true; } +bool InstanceManager::update_clock() { + if (!is_game_session_started()) { + Logger::error("Cannot update clock - game session not started!"); + return false; + } + + simulation_clock.conditionally_advance_game(); + return true; +} + bool InstanceManager::expand_selected_province_building(size_t building_index) { set_gamestate_needs_update(); ProvinceInstance* province = map_instance.get_selected_province(); |