aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-19 13:58:20 +0200
committer hop311 <hop3114@gmail.com>2024-10-29 14:53:14 +0100
commitb7b94da345d66f839164ec25450576525474b357 (patch)
treeeba311a156fd5a1626092362840047e0dd0ed79e /src/openvic-simulation/GameManager.hpp
parent309deb6a5b28c8e2b24e73d06f1418bb992b4cd7 (diff)
Test that modifier calculation methods produce the same resultsresultant-modifier-test
Diffstat (limited to 'src/openvic-simulation/GameManager.hpp')
-rw-r--r--src/openvic-simulation/GameManager.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/openvic-simulation/GameManager.hpp b/src/openvic-simulation/GameManager.hpp
index 91de279..4dba4ff 100644
--- a/src/openvic-simulation/GameManager.hpp
+++ b/src/openvic-simulation/GameManager.hpp
@@ -6,12 +6,17 @@
#include "openvic-simulation/DefinitionManager.hpp"
#include "openvic-simulation/InstanceManager.hpp"
+#include "openvic-simulation/ModifierCalculationTestToggle.hpp"
+
namespace OpenVic {
struct GameManager {
private:
Dataloader PROPERTY(dataloader);
DefinitionManager PROPERTY(definition_manager);
std::optional<InstanceManager> instance_manager;
+#if OV_MODIFIER_CALCULATION_TEST
+ std::optional<InstanceManager> instance_manager_no_add;
+#endif
InstanceManager::gamestate_updated_func_t gamestate_updated_callback;
SimulationClock::state_changed_function_t clock_state_changed_callback;
@@ -31,6 +36,16 @@ namespace OpenVic {
return instance_manager ? &*instance_manager : nullptr;
}
+#if OV_MODIFIER_CALCULATION_TEST
+ inline constexpr InstanceManager* get_instance_manager_no_add() {
+ return instance_manager_no_add ? &*instance_manager_no_add : nullptr;
+ }
+
+ inline constexpr InstanceManager const* get_instance_manager_no_add() const {
+ return instance_manager_no_add ? &*instance_manager_no_add : nullptr;
+ }
+#endif
+
bool set_roots(Dataloader::path_vector_t const& roots);
bool load_definitions(Dataloader::localisation_callback_t localisation_callback);