diff options
author | Hop311 <Hop3114@gmail.com> | 2024-03-20 23:30:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 23:30:48 +0100 |
commit | eece77afebf0e4d36b4c9ace3b1044f2c3da50f1 (patch) | |
tree | d5b186facf7c3a08e6ccf2e8261b7de054957a41 /src/openvic-simulation/military/UnitInstance.cpp | |
parent | 2c892c99a6647be15ef23cabf6cc40f08769283d (diff) | |
parent | 023860d53a90774dcdba84ad7c0dca3c944c9a49 (diff) |
Merge pull request #147 from OpenVicProject/military-units
Military unit instance
Diffstat (limited to 'src/openvic-simulation/military/UnitInstance.cpp')
-rw-r--r-- | src/openvic-simulation/military/UnitInstance.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/openvic-simulation/military/UnitInstance.cpp b/src/openvic-simulation/military/UnitInstance.cpp new file mode 100644 index 0000000..7927b0f --- /dev/null +++ b/src/openvic-simulation/military/UnitInstance.cpp @@ -0,0 +1,31 @@ +#include "UnitInstance.hpp" +#include <vector> +#include "openvic-simulation/military/UnitType.hpp" + +using namespace OpenVic; + +RegimentInstance::RegimentInstance(std::string_view new_name, RegimentType const& new_regiment_type, Pop& new_pop) + : UnitInstance { new_name, new_regiment_type }, pop { new_pop } {} + +ShipInstance::ShipInstance(std::string_view new_name, ShipType const& new_ship_type) + : UnitInstance { new_name, new_ship_type } {} + +MovementInfo::MovementInfo() : path {}, movement_progress {} {} + +//TODO: pathfinding logic +MovementInfo::MovementInfo(Province const* starting_province, Province const* target_province) + : path { std::vector { starting_province, target_province } }, movement_progress { 0 } {} + +ArmyInstance::ArmyInstance( + std::string_view new_name, + std::vector<RegimentInstance*>&& new_units, + Leader const* new_leader, + Province const* new_position +) : UnitInstanceGroup { new_name, UnitType::branch_t::LAND, std::move(new_units), new_leader, new_position } {} + +NavyInstance::NavyInstance( + std::string_view new_name, + std::vector<ShipInstance*>&& new_units, + Leader const* new_leader, + Province const* new_position +) : UnitInstanceGroup { new_name, UnitType::branch_t::NAVAL, std::move(new_units), new_leader, new_position } {}
\ No newline at end of file |