aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country/CountryInstance.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-07-19 00:25:38 +0200
committer hop311 <hop3114@gmail.com>2024-07-19 00:26:27 +0200
commitd8baf57d46539da9edba5952f73089bf9a54bdaf (patch)
tree6d2de5221d2b1945a065e0abba8198d8a052a92a /src/openvic-simulation/country/CountryInstance.hpp
parenta673f89bb2705826b1c646365eab1775727372b7 (diff)
Unit position/country/leader handling + more use of unit branch templatesunit-work
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.hpp')
-rw-r--r--src/openvic-simulation/country/CountryInstance.hpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.hpp b/src/openvic-simulation/country/CountryInstance.hpp
index 885a5fd..1eaf398 100644
--- a/src/openvic-simulation/country/CountryInstance.hpp
+++ b/src/openvic-simulation/country/CountryInstance.hpp
@@ -54,6 +54,11 @@ namespace OpenVic {
plf::colony<General> PROPERTY(generals);
plf::colony<Admiral> PROPERTY(admirals);
+ ordered_set<ArmyInstance*> PROPERTY(armies);
+ ordered_set<NavyInstance*> PROPERTY(navies);
+
+ UNIT_BRANCHED_GETTER(get_unit_instance_groups, armies, navies);
+ UNIT_BRANCHED_GETTER(get_leaders, generals, admirals);
CountryInstance(
CountryDefinition const* new_country_definition, decltype(technologies)::keys_t const& technology_keys,
@@ -70,13 +75,15 @@ namespace OpenVic {
bool add_reform(Reform const* new_reform);
bool remove_reform(Reform const* reform_to_remove);
- void add_general(General&& new_general);
- bool remove_general(General const* general_to_remove);
- void add_admiral(Admiral&& new_admiral);
- bool remove_admiral(Admiral const* admiral_to_remove);
+ template<UnitType::branch_t Branch>
+ bool add_unit_instance_group(UnitInstanceGroup<Branch>& group);
+ template<UnitType::branch_t Branch>
+ bool remove_unit_instance_group(UnitInstanceGroup<Branch>& group);
- bool add_leader(LeaderBase const& new_leader);
- bool remove_leader(LeaderBase const* leader_to_remove);
+ template<UnitType::branch_t Branch>
+ void add_leader(LeaderBranched<Branch>&& leader);
+ template<UnitType::branch_t Branch>
+ bool remove_leader(LeaderBranched<Branch> const* leader);
bool apply_history_to_country(CountryHistoryEntry const* entry);
};