aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-07 23:22:24 +0200
committer GitHub <noreply@github.com>2024-09-07 23:22:24 +0200
commit1c210c13dbcce431bd4b799fb80f62db121313ed (patch)
treea74df27b1facae8a8a926a2be9edd2deb844b4eb
parentfa7fdd637df1ae98ebb3f565b91cee764746bb92 (diff)
parent8a481ee97360bf35c19dbdd9720f86616b2d8647 (diff)
Merge pull request #263 from OpenVicProject/update-clock
Update openvic-simulation to OpenVicProject/OpenVic-Simulation@d360457
m---------extension/deps/openvic-simulation0
-rw-r--r--extension/src/openvic-extension/singletons/GameSingleton.cpp9
-rw-r--r--extension/src/openvic-extension/singletons/GameSingleton.hpp2
-rw-r--r--game/src/Game/GameSession/GameSession.gd2
4 files changed, 5 insertions, 8 deletions
diff --git a/extension/deps/openvic-simulation b/extension/deps/openvic-simulation
-Subproject 8d5068c1db9a02a34d675536f41aee61ec3e482
+Subproject d36045735fc56e8cfe772713c2ef5012dad94ae
diff --git a/extension/src/openvic-extension/singletons/GameSingleton.cpp b/extension/src/openvic-extension/singletons/GameSingleton.cpp
index 13324d0..24d8a73 100644
--- a/extension/src/openvic-extension/singletons/GameSingleton.cpp
+++ b/extension/src/openvic-extension/singletons/GameSingleton.cpp
@@ -69,7 +69,7 @@ void GameSingleton::_bind_methods() {
OV_BIND_METHOD(GameSingleton::set_selected_province, { "index" });
OV_BIND_METHOD(GameSingleton::unset_selected_province);
- OV_BIND_METHOD(GameSingleton::try_tick);
+ OV_BIND_METHOD(GameSingleton::update_clock);
ADD_SIGNAL(MethodInfo(_signal_gamestate_updated()));
ADD_SIGNAL(MethodInfo(_signal_province_selected(), PropertyInfo(Variant::INT, "index")));
@@ -349,11 +349,8 @@ void GameSingleton::unset_selected_province() {
set_selected_province(ProvinceDefinition::NULL_INDEX);
}
-void GameSingleton::try_tick() {
- InstanceManager* instance_manager = get_instance_manager();
- ERR_FAIL_NULL(instance_manager);
-
- instance_manager->get_simulation_clock().conditionally_advance_game();
+Error GameSingleton::update_clock() {
+ return ERR(game_manager.update_clock());
}
Error GameSingleton::_load_map_images() {
diff --git a/extension/src/openvic-extension/singletons/GameSingleton.hpp b/extension/src/openvic-extension/singletons/GameSingleton.hpp
index 3c6d8f8..e0eb5fc 100644
--- a/extension/src/openvic-extension/singletons/GameSingleton.hpp
+++ b/extension/src/openvic-extension/singletons/GameSingleton.hpp
@@ -124,6 +124,6 @@ namespace OpenVic {
void set_selected_province(int32_t index);
void unset_selected_province();
- void try_tick();
+ godot::Error update_clock();
};
}
diff --git a/game/src/Game/GameSession/GameSession.gd b/game/src/Game/GameSession/GameSession.gd
index 30e6c1c..9d07fd6 100644
--- a/game/src/Game/GameSession/GameSession.gd
+++ b/game/src/Game/GameSession/GameSession.gd
@@ -14,7 +14,7 @@ func _ready() -> void:
MusicConductor.select_next_song()
func _process(_delta : float) -> void:
- GameSingleton.try_tick()
+ GameSingleton.update_clock()
# REQUIREMENTS:
# * SS-42