aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/InstanceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/InstanceManager.cpp')
-rw-r--r--src/openvic-simulation/InstanceManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openvic-simulation/InstanceManager.cpp b/src/openvic-simulation/InstanceManager.cpp
index eaa0692..1cbf53c 100644
--- a/src/openvic-simulation/InstanceManager.cpp
+++ b/src/openvic-simulation/InstanceManager.cpp
@@ -6,9 +6,15 @@
using namespace OpenVic;
InstanceManager::InstanceManager(
+#if OV_MODIFIER_CALCULATION_TEST
+ bool new_ADD_OWNER_CONTRIBUTION,
+#endif
DefinitionManager const& new_definition_manager, gamestate_updated_func_t gamestate_updated_callback,
SimulationClock::state_changed_function_t clock_state_changed_callback
) : definition_manager { new_definition_manager },
+#if OV_MODIFIER_CALCULATION_TEST
+ ADD_OWNER_CONTRIBUTION { new_ADD_OWNER_CONTRIBUTION },
+#endif
map_instance { new_definition_manager.get_map_definition() },
simulation_clock {
std::bind(&InstanceManager::tick, this), std::bind(&InstanceManager::update_gamestate, this),
@@ -39,7 +45,11 @@ void InstanceManager::update_gamestate() {
Logger::info("Update: ", today);
+#if OV_MODIFIER_CALCULATION_TEST
+ if (ADD_OWNER_CONTRIBUTION) {
+#else
if constexpr (ProvinceInstance::ADD_OWNER_CONTRIBUTION) {
+#endif
// Calculate local province modifier sums first, then national country modifier sums, then loop over owned provinces
// adding their contributions to the owner country's modifier sum and loop over them again to add the country's total
// (including province contributions) to the provinces' modifier sum. This results in every country and province
@@ -99,11 +109,17 @@ bool InstanceManager::setup() {
bool ret = good_instance_manager.setup(definition_manager.get_economy_manager().get_good_definition_manager());
ret &= map_instance.setup(
+#if OV_MODIFIER_CALCULATION_TEST
+ ADD_OWNER_CONTRIBUTION,
+#endif
definition_manager.get_economy_manager().get_building_type_manager(),
definition_manager.get_pop_manager().get_pop_types(),
definition_manager.get_politics_manager().get_ideology_manager().get_ideologies()
);
ret &= country_instance_manager.generate_country_instances(
+#if OV_MODIFIER_CALCULATION_TEST
+ ADD_OWNER_CONTRIBUTION,
+#endif
definition_manager.get_country_definition_manager(),
definition_manager.get_economy_manager().get_building_type_manager().get_building_types(),
definition_manager.get_research_manager().get_technology_manager().get_technologies(),