diff options
author | hop311 <hop3114@gmail.com> | 2024-10-06 01:08:44 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-10-06 23:43:10 +0200 |
commit | 6181851281876730d7db4bed18791fdbbe3cfbbc (patch) | |
tree | 9d97602eb4b02688ea6b4e5bca060b1031c543d5 /src/openvic-simulation/map/ProvinceInstance.hpp | |
parent | 3713393682c16fd5d3bed3e12fef68a1559c0cc5 (diff) |
Add alternative modifier calculation (keeping country modifiers out of their owned provinces' modifier sums)
Diffstat (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp')
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index 0b02c41..91e8ee1 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -69,7 +69,12 @@ namespace OpenVic { CountryInstance* PROPERTY(controller); ordered_set<CountryInstance*> PROPERTY(cores); - // The total/resultant modifier affecting this province, including owner country contributions. + public: + static constexpr bool ADD_OWNER_CONTRIBUTION = true; + + private: + // The total/resultant modifier affecting this province, including owner country contributions if + // ADD_OWNER_CONTRIBUTION is true. ModifierSum PROPERTY(modifier_sum); std::vector<ModifierInstance> PROPERTY(event_modifiers); @@ -133,6 +138,10 @@ namespace OpenVic { 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 push_contributing_modifiers( + ModifierEffect const& effect, std::vector<ModifierSum::modifier_entry_t>& contributions + ) const; + std::vector<ModifierSum::modifier_entry_t> get_contributing_modifiers(ModifierEffect const& effect) const; void update_gamestate(Date today, DefineManager const& define_manager); void tick(Date today); |