diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-19 21:35:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 21:35:22 +0200 |
commit | e0518bee9b4c164f40716a8033b5e207c2060c0b (patch) | |
tree | 6d2de5221d2b1945a065e0abba8198d8a052a92a /src/openvic-simulation/military/Deployment.cpp | |
parent | a673f89bb2705826b1c646365eab1775727372b7 (diff) | |
parent | d8baf57d46539da9edba5952f73089bf9a54bdaf (diff) |
Merge pull request #175 from OpenVicProject/unit-work
Unit position/country/leader handling + more use of unit branch templates
Diffstat (limited to 'src/openvic-simulation/military/Deployment.cpp')
-rw-r--r-- | src/openvic-simulation/military/Deployment.cpp | 15 |
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, |