diff options
author | Hop311 <Hop3114@gmail.com> | 2024-04-15 20:59:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:59:47 +0200 |
commit | a57e81703102bc52297fbdc074da755fa8edbedd (patch) | |
tree | 54a0ad26ef3cec9a56644479611e8abaad62b1f7 /src/openvic-simulation/country/CountryInstance.hpp | |
parent | 109d31f147512c8d51f35f9773cd3c6bb1b8b994 (diff) | |
parent | 5799836bee29024ce8a2d0fc45e06664c0110751 (diff) |
Merge pull request #154 from OpenVicProject/units
Generate starting unit instances
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.hpp')
-rw-r--r-- | src/openvic-simulation/country/CountryInstance.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.hpp b/src/openvic-simulation/country/CountryInstance.hpp index 98c6e90..7efd930 100644 --- a/src/openvic-simulation/country/CountryInstance.hpp +++ b/src/openvic-simulation/country/CountryInstance.hpp @@ -6,8 +6,11 @@ #include "openvic-simulation/utility/Getters.hpp" namespace OpenVic { + struct UnitInstanceManager; + /* Representation of an existing country that is currently in-game. */ struct CountryInstance { + friend struct CountryInstanceManager; private: Country const* PROPERTY_RW(base_country); Culture const* PROPERTY_RW(primary_culture); @@ -25,7 +28,11 @@ namespace OpenVic { std::vector<Reform const*> PROPERTY(reforms); // TODO: should be map of reform groups to active reforms: must set defaults & validate applied history // TODO: Military units + OOBs; will probably need an extensible deployment class + CountryInstance(Country const* new_base_country); + public: + std::string_view get_identifier() const; + bool add_accepted_culture(Culture const* new_accepted_culture); bool remove_accepted_culture(Culture const* culture_to_remove); /* Add or modify a party in the upper house. */ @@ -34,6 +41,18 @@ namespace OpenVic { bool add_reform(Reform const* new_reform); bool remove_reform(Reform const* reform_to_remove); - bool apply_history_to_country(CountryHistoryMap const& history, Date date); + bool apply_history_to_country(CountryHistoryEntry const* entry); + }; + + struct CountryInstanceManager { + private: + std::vector<CountryInstance> PROPERTY(country_instances); + + public: + bool generate_country_instances(CountryManager const& country_manager); + + bool apply_history_to_countries( + CountryHistoryManager const& history_manager, Date date, UnitInstanceManager& unit_instance_manager, Map& map + ); }; } // namespace OpenVic |