From 37cdd775ac738b2a1264e32471385376e5a34f3a Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 3 Jun 2024 23:39:34 +0100 Subject: Province const/mutable separation + State cleanup --- src/openvic-simulation/country/CountryInstance.cpp | 2 ++ src/openvic-simulation/country/CountryInstance.hpp | 29 +++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'src/openvic-simulation/country') diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp index b7b818e..58e5232 100644 --- a/src/openvic-simulation/country/CountryInstance.cpp +++ b/src/openvic-simulation/country/CountryInstance.cpp @@ -1,5 +1,7 @@ #include "CountryInstance.hpp" +#include "openvic-simulation/country/Country.hpp" +#include "openvic-simulation/history/CountryHistory.hpp" #include "openvic-simulation/military/UnitInstance.hpp" using namespace OpenVic; diff --git a/src/openvic-simulation/country/CountryInstance.hpp b/src/openvic-simulation/country/CountryInstance.hpp index 7efd930..33cee61 100644 --- a/src/openvic-simulation/country/CountryInstance.hpp +++ b/src/openvic-simulation/country/CountryInstance.hpp @@ -1,12 +1,22 @@ #pragma once -#include "openvic-simulation/country/Country.hpp" -#include "openvic-simulation/history/CountryHistory.hpp" -#include "openvic-simulation/map/Province.hpp" +#include + +#include "openvic-simulation/types/Date.hpp" +#include "openvic-simulation/types/fixed_point/FixedPointMap.hpp" #include "openvic-simulation/utility/Getters.hpp" namespace OpenVic { - struct UnitInstanceManager; + struct Country; + struct Culture; + struct Religion; + struct CountryParty; + struct Ideology; + struct ProvinceDefinition; + struct GovernmentType; + struct NationalValue; + struct Reform; + struct CountryHistoryEntry; /* Representation of an existing country that is currently in-game. */ struct CountryInstance { @@ -19,7 +29,9 @@ namespace OpenVic { CountryParty const* PROPERTY_RW(ruling_party); Date PROPERTY_RW(last_election); fixed_point_map_t PROPERTY(upper_house); - Province const* PROPERTY_RW(capital); + // TODO - should this be ProvinceInstance and/or non-const pointer? + // Currently ProvinceDefinition as that's what CountryHistoryEntry has (loaded prior to ProvinceInstance generation) + ProvinceDefinition const* PROPERTY_RW(capital); GovernmentType const* PROPERTY_RW(government_type); fixed_point_t PROPERTY_RW(plurality); NationalValue const* PROPERTY_RW(national_value); @@ -44,6 +56,11 @@ namespace OpenVic { bool apply_history_to_country(CountryHistoryEntry const* entry); }; + struct CountryManager; + struct CountryHistoryManager; + struct UnitInstanceManager; + struct Map; + struct CountryInstanceManager { private: std::vector PROPERTY(country_instances); @@ -55,4 +72,4 @@ namespace OpenVic { CountryHistoryManager const& history_manager, Date date, UnitInstanceManager& unit_instance_manager, Map& map ); }; -} // namespace OpenVic +} -- cgit v1.2.3-56-ga3b1