From 41d50b15ac978530a53ed99eea36f180e1d27b16 Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 14 Jun 2024 23:06:19 +0100 Subject: Renamed Country to CountryDefinition --- src/openvic-simulation/map/MapInstance.cpp | 2 +- src/openvic-simulation/map/MapInstance.hpp | 4 ++-- src/openvic-simulation/map/Mapmode.cpp | 2 +- src/openvic-simulation/map/ProvinceInstance.cpp | 8 ++++---- src/openvic-simulation/map/ProvinceInstance.hpp | 13 +++++++------ src/openvic-simulation/map/State.cpp | 5 ++--- src/openvic-simulation/map/State.hpp | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/openvic-simulation/map') diff --git a/src/openvic-simulation/map/MapInstance.cpp b/src/openvic-simulation/map/MapInstance.cpp index 093d341..1547ade 100644 --- a/src/openvic-simulation/map/MapInstance.cpp +++ b/src/openvic-simulation/map/MapInstance.cpp @@ -86,7 +86,7 @@ bool MapInstance::setup(BuildingTypeManager const& building_type_manager) { bool MapInstance::apply_history_to_provinces( ProvinceHistoryManager const& history_manager, Date date, IdeologyManager const& ideology_manager, - IssueManager const& issue_manager, Country const& country + IssueManager const& issue_manager, CountryDefinition const& country ) { bool ret = true; diff --git a/src/openvic-simulation/map/MapInstance.hpp b/src/openvic-simulation/map/MapInstance.hpp index 353a3a4..2c0ff74 100644 --- a/src/openvic-simulation/map/MapInstance.hpp +++ b/src/openvic-simulation/map/MapInstance.hpp @@ -12,7 +12,7 @@ namespace OpenVic { struct ProvinceHistoryManager; struct IdeologyManager; struct IssueManager; - struct Country; + struct CountryDefinition; /* REQUIREMENTS: * MAP-4 @@ -47,7 +47,7 @@ namespace OpenVic { bool setup(BuildingTypeManager const& building_type_manager); bool apply_history_to_provinces( ProvinceHistoryManager const& history_manager, Date date, IdeologyManager const& ideology_manager, - IssueManager const& issue_manager, Country const& country + IssueManager const& issue_manager, CountryDefinition const& country ); void update_gamestate(Date today); diff --git a/src/openvic-simulation/map/Mapmode.cpp b/src/openvic-simulation/map/Mapmode.cpp index 410ea2b..f03b0e8 100644 --- a/src/openvic-simulation/map/Mapmode.cpp +++ b/src/openvic-simulation/map/Mapmode.cpp @@ -2,7 +2,7 @@ #include -#include "openvic-simulation/country/Country.hpp" +#include "openvic-simulation/country/CountryDefinition.hpp" #include "openvic-simulation/map/MapDefinition.hpp" #include "openvic-simulation/map/MapInstance.hpp" #include "openvic-simulation/map/ProvinceDefinition.hpp" diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp index 2a0863d..967d72b 100644 --- a/src/openvic-simulation/map/ProvinceInstance.cpp +++ b/src/openvic-simulation/map/ProvinceInstance.cpp @@ -1,6 +1,6 @@ #include "ProvinceInstance.hpp" -#include "openvic-simulation/country/Country.hpp" +#include "openvic-simulation/country/CountryDefinition.hpp" #include "openvic-simulation/history/ProvinceHistory.hpp" #include "openvic-simulation/map/ProvinceDefinition.hpp" #include "openvic-simulation/military/UnitInstance.hpp" @@ -176,7 +176,7 @@ bool ProvinceInstance::apply_history_to_province(ProvinceHistoryEntry const* ent if (entry->get_owner()) owner = *entry->get_owner(); if (entry->get_controller()) controller = *entry->get_controller(); if (entry->get_slave()) slave = *entry->get_slave(); - for (Country const* core : entry->get_remove_cores()) { + for (CountryDefinition const* core : entry->get_remove_cores()) { const typename decltype(cores)::iterator existing_core = std::find(cores.begin(), cores.end(), core); if (existing_core != cores.end()) { cores.erase(existing_core); @@ -186,7 +186,7 @@ bool ProvinceInstance::apply_history_to_province(ProvinceHistoryEntry const* ent ); } } - for (Country const* core : entry->get_add_cores()) { + for (CountryDefinition const* core : entry->get_add_cores()) { const typename decltype(cores)::iterator existing_core = std::find(cores.begin(), cores.end(), core); if (existing_core == cores.end()) { cores.push_back(core); @@ -215,7 +215,7 @@ bool ProvinceInstance::apply_history_to_province(ProvinceHistoryEntry const* ent } void ProvinceInstance::setup_pop_test_values( - IdeologyManager const& ideology_manager, IssueManager const& issue_manager, Country const& country + IdeologyManager const& ideology_manager, IssueManager const& issue_manager, CountryDefinition const& country ) { for (Pop& pop : pops) { pop.setup_pop_test_values(ideology_manager, issue_manager, country); diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index 67ce423..8e8ec93 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -11,7 +11,7 @@ namespace OpenVic { struct ProvinceDefinition; struct TerrainType; struct State; - struct Country; + struct CountryDefinition; struct Crime; struct GoodDefinition; struct ArmyInstance; @@ -31,16 +31,17 @@ namespace OpenVic { enum struct colony_status_t : uint8_t { STATE, PROTECTORATE, COLONY }; + private: ProvinceDefinition const& PROPERTY(province_definition); - /* Mutable attributes (reset before loading history) */ TerrainType const* PROPERTY(terrain_type); life_rating_t PROPERTY(life_rating); colony_status_t PROPERTY(colony_status); State const* PROPERTY_RW(state); - Country const* PROPERTY(owner); - Country const* PROPERTY(controller); - std::vector PROPERTY(cores); + CountryDefinition const* PROPERTY(owner); + CountryDefinition const* PROPERTY(controller); + // Cores being CountryDefinitions means then they won't be affected by tag switched (as desired) + std::vector PROPERTY(cores); bool PROPERTY(slave); Crime const* PROPERTY_RW(crime); // TODO - change this into a factory-like structure @@ -86,7 +87,7 @@ namespace OpenVic { bool apply_history_to_province(ProvinceHistoryEntry const* entry); void setup_pop_test_values( - IdeologyManager const& ideology_manager, IssueManager const& issue_manager, Country const& country + IdeologyManager const& ideology_manager, IssueManager const& issue_manager, CountryDefinition const& country ); }; } diff --git a/src/openvic-simulation/map/State.cpp b/src/openvic-simulation/map/State.cpp index 46ff11d..42d84cc 100644 --- a/src/openvic-simulation/map/State.cpp +++ b/src/openvic-simulation/map/State.cpp @@ -1,6 +1,5 @@ #include "State.hpp" -#include "openvic-simulation/country/Country.hpp" #include "openvic-simulation/map/MapDefinition.hpp" #include "openvic-simulation/map/MapInstance.hpp" #include "openvic-simulation/map/ProvinceInstance.hpp" @@ -9,8 +8,8 @@ using namespace OpenVic; State::State( - StateSet const& new_state_set, Country const* owner, ProvinceInstance* capital, std::vector&& provinces, - ProvinceInstance::colony_status_t colony_status + StateSet const& new_state_set, CountryDefinition const* owner, ProvinceInstance* capital, + std::vector&& provinces, ProvinceInstance::colony_status_t colony_status ) : state_set { new_state_set }, owner { owner }, capital { capital }, provinces { std::move(provinces) }, colony_status { colony_status } {} diff --git a/src/openvic-simulation/map/State.hpp b/src/openvic-simulation/map/State.hpp index ff8acfa..6111668 100644 --- a/src/openvic-simulation/map/State.hpp +++ b/src/openvic-simulation/map/State.hpp @@ -9,7 +9,7 @@ namespace OpenVic { struct StateManager; struct StateSet; - struct Country; + struct CountryDefinition; struct ProvinceInstance; struct State { @@ -17,7 +17,7 @@ namespace OpenVic { private: StateSet const& PROPERTY(state_set); - Country const* PROPERTY(owner); + CountryDefinition const* PROPERTY(owner); ProvinceInstance* PROPERTY(capital); std::vector PROPERTY(provinces); ProvinceInstance::colony_status_t PROPERTY(colony_status); @@ -25,7 +25,7 @@ namespace OpenVic { Pop::pop_size_t PROPERTY(total_population); State( - StateSet const& new_state_set, Country const* owner, ProvinceInstance* capital, + StateSet const& new_state_set, CountryDefinition const* owner, ProvinceInstance* capital, std::vector&& provinces, ProvinceInstance::colony_status_t colony_status ); -- cgit v1.2.3-56-ga3b1