aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r--src/openvic-simulation/GameManager.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp
index 2980dbd..84666cb 100644
--- a/src/openvic-simulation/GameManager.cpp
+++ b/src/openvic-simulation/GameManager.cpp
@@ -49,10 +49,21 @@ bool GameManager::setup_instance(Bookmark const* bookmark) {
Logger::info("Setting up first game instance.");
}
- instance_manager.emplace(definition_manager, gamestate_updated_callback, clock_state_changed_callback);
+ bool ret = true;
- bool ret = instance_manager->setup();
+#if OV_MODIFIER_CALCULATION_TEST
+ instance_manager.emplace(true, definition_manager, gamestate_updated_callback, clock_state_changed_callback);
+ ret &= instance_manager->setup();
+ ret &= instance_manager->load_bookmark(bookmark);
+
+ instance_manager_no_add.emplace(false, definition_manager, gamestate_updated_callback, clock_state_changed_callback);
+ ret &= instance_manager_no_add->setup();
+ ret &= instance_manager_no_add->load_bookmark(bookmark);
+#else
+ instance_manager.emplace(definition_manager, gamestate_updated_callback, clock_state_changed_callback);
+ ret &= instance_manager->setup();
ret &= instance_manager->load_bookmark(bookmark);
+#endif
return ret;
}
@@ -72,7 +83,11 @@ bool GameManager::start_game_session() {
Logger::warning("Starting game session with no bookmark loaded!");
}
+#if OV_MODIFIER_CALCULATION_TEST
+ return instance_manager->start_game_session() & instance_manager_no_add->start_game_session();
+#else
return instance_manager->start_game_session();
+#endif
}
bool GameManager::update_clock() {
@@ -81,5 +96,9 @@ bool GameManager::update_clock() {
return false;
}
+#if OV_MODIFIER_CALCULATION_TEST
+ return instance_manager->update_clock() & instance_manager_no_add->update_clock();
+#else
return instance_manager->update_clock();
+#endif
}