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/map/ProvinceInstance.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/map/ProvinceInstance.cpp')
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp index 64a104b..b3d2df3 100644 --- a/src/openvic-simulation/map/ProvinceInstance.cpp +++ b/src/openvic-simulation/map/ProvinceInstance.cpp @@ -1,6 +1,7 @@ #include "ProvinceInstance.hpp" #include "openvic-simulation/country/CountryInstance.hpp" +#include "openvic-simulation/defines/Define.hpp" #include "openvic-simulation/economy/production/ProductionType.hpp" #include "openvic-simulation/economy/production/ResourceGatheringOperation.hpp" #include "openvic-simulation/history/ProvinceHistory.hpp" @@ -9,7 +10,6 @@ #include "openvic-simulation/map/Region.hpp" #include "openvic-simulation/map/TerrainType.hpp" #include "openvic-simulation/military/UnitInstanceGroup.hpp" -#include "openvic-simulation/misc/Define.hpp" #include "openvic-simulation/modifier/StaticModifierCache.hpp" #include "openvic-simulation/politics/Ideology.hpp" #include "openvic-simulation/pop/Pop.hpp" @@ -184,12 +184,14 @@ void ProvinceInstance::_update_pops(DefineManager const& define_manager) { max_supported_regiments = 0; + MilitaryDefines const& military_defines = define_manager.get_military_defines(); + using enum colony_status_t; const fixed_point_t pop_size_per_regiment_multiplier = - colony_status == PROTECTORATE ? define_manager.get_pop_size_per_regiment_protectorate_multiplier() - : colony_status == COLONY ? define_manager.get_pop_size_per_regiment_colony_multiplier() - : is_owner_core() ? fixed_point_t::_1() : define_manager.get_pop_size_per_regiment_non_core_multiplier(); + colony_status == PROTECTORATE ? military_defines.get_pop_size_per_regiment_protectorate_multiplier() + : colony_status == COLONY ? military_defines.get_pop_size_per_regiment_colony_multiplier() + : is_owner_core() ? fixed_point_t::_1() : military_defines.get_pop_size_per_regiment_non_core_multiplier(); for (Pop& pop : pops) { pop.update_gamestate(define_manager, owner, pop_size_per_regiment_multiplier); |