aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/Deployment.cpp
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/military/Deployment.cpp
parenta673f89bb2705826b1c646365eab1775727372b7 (diff)
Unit position/country/leader handling + more use of unit branch templatesunit-work
Diffstat (limited to 'src/openvic-simulation/military/Deployment.cpp')
-rw-r--r--src/openvic-simulation/military/Deployment.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/openvic-simulation/military/Deployment.cpp b/src/openvic-simulation/military/Deployment.cpp
index 9c89690..bd176be 100644
--- a/src/openvic-simulation/military/Deployment.cpp
+++ b/src/openvic-simulation/military/Deployment.cpp
@@ -5,20 +5,17 @@
using namespace OpenVic;
using namespace OpenVic::NodeTools;
-RegimentDeployment::RegimentDeployment(
+UnitDeployment<UnitType::branch_t::LAND>::UnitDeployment(
std::string_view new_name, RegimentType const& new_type, ProvinceDefinition const* new_home
) : name { new_name }, type { new_type }, home { new_home } {}
-ShipDeployment::ShipDeployment(std::string_view new_name, ShipType const& new_type)
+UnitDeployment<UnitType::branch_t::NAVAL>::UnitDeployment(std::string_view new_name, ShipType const& new_type)
: name { new_name }, type { new_type } {}
-ArmyDeployment::ArmyDeployment(
- std::string_view new_name, ProvinceDefinition const* new_location, std::vector<RegimentDeployment>&& new_regiments
-) : name { new_name }, location { new_location }, regiments { std::move(new_regiments) } {}
-
-NavyDeployment::NavyDeployment(
- std::string_view new_name, ProvinceDefinition const* new_location, std::vector<ShipDeployment>&& new_ships
-) : name { new_name }, location { new_location }, ships { std::move(new_ships) } {}
+template<UnitType::branch_t Branch>
+UnitDeploymentGroup<Branch>::UnitDeploymentGroup(
+ std::string_view new_name, ProvinceDefinition const* new_location, std::vector<_Unit>&& new_units
+) : name { new_name }, location { new_location }, units { std::move(new_units) } {}
Deployment::Deployment(
std::string_view new_path, std::vector<ArmyDeployment>&& new_armies, std::vector<NavyDeployment>&& new_navies,