aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-31 20:29:34 +0100
committer hop311 <hop3114@gmail.com>2024-10-31 20:54:50 +0100
commitdbf58b1b1d318b4a82cf22b5b8e720c753388f4b (patch)
treed6d2be10697d6fa320f7f8da14eda45111bd9399 /src/openvic-simulation/country
parentc763a0aedd834432b54b6e49c6bc7e1936be1131 (diff)
Load defines directly into named and typed variables rather than using an IdentifierRegistrydefines-variables
Diffstat (limited to 'src/openvic-simulation/country')
-rw-r--r--src/openvic-simulation/country/CountryInstance.cpp14
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