diff options
Diffstat (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp')
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index fa0be98..e7c0326 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" @@ -21,6 +22,7 @@ namespace OpenVic { struct Ideology; struct Culture; struct Religion; + struct StaticModifierCache; struct BuildingTypeManager; struct ProvinceHistoryEntry; struct IssueManager; @@ -68,6 +70,15 @@ namespace OpenVic { CountryInstance* PROPERTY(controller); ordered_set<CountryInstance*> PROPERTY(cores); + 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); + bool PROPERTY(slave); Crime const* PROPERTY_RW(crime); // TODO - change this into a factory-like structure @@ -124,6 +135,15 @@ namespace OpenVic { bool add_pop_vec(std::vector<PopBase> 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 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); |