From eb77495ba874d474bbbbc950a65e8f496b13f285 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sun, 29 Sep 2024 21:37:11 +0100 Subject: Calculate country and province resultant modifier sums --- src/openvic-simulation/map/ProvinceInstance.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp') diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index fa0be98..0b02c41 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -5,6 +5,7 @@ #include "openvic-simulation/economy/BuildingInstance.hpp" #include "openvic-simulation/military/UnitInstance.hpp" #include "openvic-simulation/military/UnitType.hpp" +#include "openvic-simulation/modifier/ModifierSum.hpp" #include "openvic-simulation/pop/Pop.hpp" #include "openvic-simulation/types/fixed_point/FixedPointMap.hpp" #include "openvic-simulation/types/HasIdentifier.hpp" @@ -68,6 +69,10 @@ namespace OpenVic { CountryInstance* PROPERTY(controller); ordered_set PROPERTY(cores); + // The total/resultant modifier affecting this province, including owner country contributions. + ModifierSum PROPERTY(modifier_sum); + std::vector PROPERTY(event_modifiers); + bool PROPERTY(slave); Crime const* PROPERTY_RW(crime); // TODO - change this into a factory-like structure @@ -124,6 +129,11 @@ namespace OpenVic { bool add_pop_vec(std::vector const& pop_vec); size_t get_pop_count() const; + void update_modifier_sum(Date today, StaticModifierCache const& static_modifier_cache); + void contribute_country_modifier_sum(ModifierSum const& owner_modifier_sum); + fixed_point_t get_modifier_effect_value(ModifierEffect const& effect) const; + fixed_point_t get_modifier_effect_value_nullcheck(ModifierEffect const* effect) const; + void update_gamestate(Date today, DefineManager const& define_manager); void tick(Date today); -- cgit v1.2.3-56-ga3b1