diff options
author | zaaarf <80046572+zaaarf@users.noreply.github.com> | 2024-01-07 23:51:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-07 23:51:06 +0100 |
commit | 79b8b73304753fedab822e6aa859fa15673f52cc (patch) | |
tree | cb25cfb89f8b06fc34f5c906e658a1b322120089 /src/openvic-simulation/politics | |
parent | 400469f08f10ffd044d9948c3f0db340c8a60db0 (diff) | |
parent | 6f07de81a6ca430c522527958e05440d67b04937 (diff) |
Merge pull request #111 from OpenVicProject/conditions-checking
Condition definition checking/loading
Diffstat (limited to 'src/openvic-simulation/politics')
-rw-r--r-- | src/openvic-simulation/politics/Ideology.cpp | 8 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Issue.cpp | 3 | ||||
-rw-r--r-- | src/openvic-simulation/politics/NationalFocus.cpp | 4 | ||||
-rw-r--r-- | src/openvic-simulation/politics/Rebel.cpp | 7 |
4 files changed, 14 insertions, 8 deletions
diff --git a/src/openvic-simulation/politics/Ideology.cpp b/src/openvic-simulation/politics/Ideology.cpp index 2678bee..692b809 100644 --- a/src/openvic-simulation/politics/Ideology.cpp +++ b/src/openvic-simulation/politics/Ideology.cpp @@ -85,8 +85,12 @@ bool IdeologyManager::load_ideology_file(ast::NodeCPtr root) { colour_t colour = colour_t::null(); bool uncivilised = true, can_reduce_militancy = false; Date spawn_date; - ConditionalWeight add_political_reform, remove_political_reform, add_social_reform, remove_social_reform, - add_military_reform, add_economic_reform; + ConditionalWeight add_political_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight remove_political_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight add_social_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight remove_social_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight add_military_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight add_economic_reform { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; bool ret = expect_dictionary_keys( "uncivilized", ZERO_OR_ONE, expect_bool(assign_variable_callback(uncivilised)), diff --git a/src/openvic-simulation/politics/Issue.cpp b/src/openvic-simulation/politics/Issue.cpp index 28e34cb..30dc1cd 100644 --- a/src/openvic-simulation/politics/Issue.cpp +++ b/src/openvic-simulation/politics/Issue.cpp @@ -159,7 +159,8 @@ bool IssueManager::_load_reform( ModifierValue values; RuleSet rules; Reform::tech_cost_t technology_cost = 0; - ConditionScript allow, on_execute_trigger; + ConditionScript allow { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionScript on_execute_trigger { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; EffectScript on_execute_effect; bool ret = modifier_manager.expect_modifier_value_and_keys(move_variable_callback(values), diff --git a/src/openvic-simulation/politics/NationalFocus.cpp b/src/openvic-simulation/politics/NationalFocus.cpp index d4066af..e509039 100644 --- a/src/openvic-simulation/politics/NationalFocus.cpp +++ b/src/openvic-simulation/politics/NationalFocus.cpp @@ -1,7 +1,5 @@ #include "NationalFocus.hpp" -#include "openvic-simulation/dataloader/NodeTools.hpp" - using namespace OpenVic; using namespace OpenVic::NodeTools; @@ -74,7 +72,7 @@ bool NationalFocusManager::load_national_foci_file(PopManager const& pop_manager NationalFocus::pop_promotion_map_t promotions; NationalFocus::party_loyalty_map_t loyalties; NationalFocus::production_map_t production; - ConditionScript limit; + ConditionScript limit { scope_t::PROVINCE | scope_t::COUNTRY, scope_t::PROVINCE | scope_t::COUNTRY, scope_t::NO_SCOPE }; Ideology const* last_specified_ideology = nullptr; // weird, I know diff --git a/src/openvic-simulation/politics/Rebel.cpp b/src/openvic-simulation/politics/Rebel.cpp index 9f8b6c4..6370786 100644 --- a/src/openvic-simulation/politics/Rebel.cpp +++ b/src/openvic-simulation/politics/Rebel.cpp @@ -104,8 +104,11 @@ bool RebelManager::load_rebels_file( allow_all_religions = true, allow_all_ideologies = true, resilient = true, reinforcing = true, general = true, smart = true, unit_transfer = false; fixed_point_t occupation_mult = 0; - ConditionalWeight will_rise, spawn_chance, movement_evaluation; - ConditionScript siege_won_trigger, demands_enforced_trigger; + ConditionalWeight will_rise { scope_t::POP, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight spawn_chance { scope_t::POP, scope_t::POP, scope_t::NO_SCOPE }; + ConditionalWeight movement_evaluation { scope_t::PROVINCE, scope_t::PROVINCE, scope_t::NO_SCOPE }; + ConditionScript siege_won_trigger { scope_t::PROVINCE, scope_t::PROVINCE, scope_t::NO_SCOPE }; + ConditionScript demands_enforced_trigger { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; EffectScript siege_won_effect, demands_enforced_effect; bool ret = expect_dictionary_keys( |