diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:50:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:50:36 +0100 |
commit | b602c10cf890c5973c1efbe8d958bf9b67499efe (patch) | |
tree | 3b34e78831ab11d6333ce2822b10244995a69848 /src/openvic-simulation/country/CountryInstance.cpp | |
parent | 968c60580997d26035496cc675138e580354332f (diff) | |
parent | dbf58b1b1d318b4a82cf22b5b8e720c753388f4b (diff) |
Merge pull request #222 from OpenVicProject/defines-variables
Load defines directly into named and typed variables rather than using an IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.cpp')
-rw-r--r-- | src/openvic-simulation/country/CountryInstance.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp index 043494d..4ecb902 100644 --- a/src/openvic-simulation/country/CountryInstance.cpp +++ b/src/openvic-simulation/country/CountryInstance.cpp @@ -1,10 +1,10 @@ #include "CountryInstance.hpp" #include "openvic-simulation/country/CountryDefinition.hpp" +#include "openvic-simulation/defines/Define.hpp" #include "openvic-simulation/history/CountryHistory.hpp" #include "openvic-simulation/map/Crime.hpp" #include "openvic-simulation/map/MapInstance.hpp" -#include "openvic-simulation/misc/Define.hpp" #include "openvic-simulation/modifier/ModifierEffectCache.hpp" #include "openvic-simulation/modifier/StaticModifierCache.hpp" #include "openvic-simulation/politics/Ideology.hpp" @@ -756,7 +756,7 @@ void CountryInstance::_update_production(DefineManager const& define_manager) { for (auto const& [country, money_invested] : foreign_investments) { if (country->exists()) { const fixed_point_t investment_industrial_power = - money_invested * define_manager.get_country_investment_industrial_score_factor() / 100; + money_invested * define_manager.get_country_defines().get_country_investment_industrial_score_factor() / 100; if (investment_industrial_power != 0) { industrial_power += investment_industrial_power; @@ -875,7 +875,7 @@ void CountryInstance::_update_military( / fixed_point_t::parse(7 * (1 + unit_type_manager.get_regiment_type_count())); if (disarmed) { - military_power_from_land *= define_manager.get_disarmed_penalty(); + military_power_from_land *= define_manager.get_diplomacy_defines().get_disarmed_penalty(); } military_power_from_sea = 0; @@ -1141,9 +1141,11 @@ void CountryInstanceManager::update_rankings(Date today, DefineManager const& de military_power_ranking[index]->military_rank = rank; } - const size_t max_great_power_rank = define_manager.get_great_power_rank(); - const size_t max_secondary_power_rank = define_manager.get_secondary_power_rank(); - const Timespan lose_great_power_grace_days = define_manager.get_lose_great_power_grace_days(); + CountryDefines const& country_defines = define_manager.get_country_defines(); + + const size_t max_great_power_rank = country_defines.get_great_power_rank(); + const size_t max_secondary_power_rank = country_defines.get_secondary_power_rank(); + const Timespan lose_great_power_grace_days = country_defines.get_lose_great_power_grace_days(); // Demote great powers who have been below the max great power rank for longer than the demotion grace period and // remove them from the list. We don't just demote them all and clear the list as when rebuilding we'd need to look |