aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/Leader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/military/Leader.hpp')
-rw-r--r--src/openvic-simulation/military/Leader.hpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/openvic-simulation/military/Leader.hpp b/src/openvic-simulation/military/Leader.hpp
index 5995164..3f8603e 100644
--- a/src/openvic-simulation/military/Leader.hpp
+++ b/src/openvic-simulation/military/Leader.hpp
@@ -1,10 +1,20 @@
#pragma once
+#include <string>
+#include <string_view>
+
#include "openvic-simulation/military/LeaderTrait.hpp"
#include "openvic-simulation/military/UnitType.hpp"
+#include "openvic-simulation/types/Date.hpp"
+#include "openvic-simulation/types/fixed_point/FixedPoint.hpp"
+#include "openvic-simulation/utility/Utility.hpp"
namespace OpenVic {
- struct Leader {
+ struct DeploymentManager;
+
+ struct LeaderBase {
+ friend struct DeploymentManager;
+
private:
std::string PROPERTY(name);
UnitType::branch_t PROPERTY(branch); /* type in defines */
@@ -14,12 +24,39 @@ namespace OpenVic {
fixed_point_t PROPERTY(prestige);
std::string PROPERTY(picture);
- public:
- Leader(
+ private:
+ LeaderBase(
std::string_view new_name, UnitType::branch_t new_branch, Date new_date, LeaderTrait const* new_personality,
LeaderTrait const* new_background, fixed_point_t new_prestige, std::string_view new_picture
);
- Leader(Leader&&) = default;
+ protected:
+ LeaderBase(LeaderBase const&) = default;
+
+ public:
+ LeaderBase(LeaderBase&&) = default;
};
-} \ No newline at end of file
+
+ struct CountryInstance;
+
+ template<UnitType::branch_t>
+ struct UnitInstanceGroup;
+
+ template<UnitType::branch_t>
+ struct UnitInstanceGroupBranched;
+
+ template<UnitType::branch_t Branch>
+ struct LeaderBranched : LeaderBase {
+
+ friend struct CountryInstance;
+ friend bool UnitInstanceGroup<Branch>::set_leader(LeaderBranched<Branch>* new_leader);
+
+ private:
+ UnitInstanceGroupBranched<Branch>* PROPERTY(unit_instance_group);
+
+ LeaderBranched(LeaderBase const& leader_base) : LeaderBase { leader_base }, unit_instance_group { nullptr } {}
+ };
+
+ using General = LeaderBranched<UnitType::branch_t::LAND>;
+ using Admiral = LeaderBranched<UnitType::branch_t::NAVAL>;
+}