From 023860d53a90774dcdba84ad7c0dca3c944c9a49 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Mon, 12 Feb 2024 12:15:04 +0100 Subject: feat: unit instance type definition, renamed existing structs for consistency --- src/openvic-simulation/military/Deployment.hpp | 70 +++++++++----------------- 1 file changed, 25 insertions(+), 45 deletions(-) (limited to 'src/openvic-simulation/military/Deployment.hpp') diff --git a/src/openvic-simulation/military/Deployment.hpp b/src/openvic-simulation/military/Deployment.hpp index e774108..742914d 100644 --- a/src/openvic-simulation/military/Deployment.hpp +++ b/src/openvic-simulation/military/Deployment.hpp @@ -5,82 +5,62 @@ #include #include "openvic-simulation/dataloader/Dataloader.hpp" -#include "openvic-simulation/dataloader/NodeTools.hpp" #include "openvic-simulation/map/Province.hpp" -#include "openvic-simulation/military/LeaderTrait.hpp" -#include "openvic-simulation/military/Unit.hpp" -#include "openvic-simulation/types/Date.hpp" -#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" +#include "openvic-simulation/military/Leader.hpp" +#include "openvic-simulation/military/UnitType.hpp" namespace OpenVic { - struct Leader { + struct RegimentDeployment { private: - std::string PROPERTY(name); - Unit::branch_t PROPERTY(branch); /* type in defines */ - Date PROPERTY(date); - LeaderTrait const* PROPERTY(personality); - LeaderTrait const* PROPERTY(background); - fixed_point_t PROPERTY(prestige); - std::string PROPERTY(picture); - - public: - Leader( - std::string_view new_name, Unit::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 - ); - }; - - struct Regiment { - private: - std::string PROPERTY(name); - LandUnit const* PROPERTY(type); + std::string PROPERTY(name); + RegimentType const* PROPERTY(type); Province const* PROPERTY(home); public: - Regiment(std::string_view new_name, LandUnit const* new_type, Province const* new_home); + RegimentDeployment(std::string_view new_name, RegimentType const* new_type, Province const* new_home); }; - struct Ship { + struct ShipDeployment { private: - std::string PROPERTY(name); - NavalUnit const* PROPERTY(type); + std::string PROPERTY(name); + ShipType const* PROPERTY(type); public: - Ship(std::string_view new_name, NavalUnit const* new_type); + ShipDeployment(std::string_view new_name, ShipType const* new_type); }; - struct Army { + struct ArmyDeployment { private: - std::string PROPERTY(name); - Province const* PROPERTY(location); - std::vector PROPERTY(regiments); + std::string PROPERTY(name); + Province const* PROPERTY(location); + std::vector PROPERTY(regiments); public: - Army(std::string_view new_name, Province const* new_location, std::vector&& new_regiments); + ArmyDeployment(std::string_view new_name, Province const* new_location, std::vector&& new_regiments); }; - struct Navy { + struct NavyDeployment { private: - std::string PROPERTY(name); - Province const* PROPERTY(location); - std::vector PROPERTY(ships); + std::string PROPERTY(name); + Province const* PROPERTY(location); + std::vector PROPERTY(ships); public: - Navy(std::string_view new_name, Province const* new_location, std::vector&& new_ships); + NavyDeployment(std::string_view new_name, Province const* new_location, std::vector&& new_ships); }; struct Deployment : HasIdentifier { friend std::unique_ptr std::make_unique( - std::string_view&&, std::vector&&, std::vector&&, std::vector&& + std::string_view&&, std::vector&&, std::vector&&, std::vector&& ); private: - std::vector PROPERTY(armies); - std::vector PROPERTY(navies); + std::vector PROPERTY(armies); + std::vector PROPERTY(navies); std::vector PROPERTY(leaders); Deployment( - std::string_view new_path, std::vector&& new_armies, std::vector&& new_navies, + std::string_view new_path, std::vector&& new_armies, std::vector&& new_navies, std::vector&& new_leaders ); @@ -95,7 +75,7 @@ namespace OpenVic { public: bool add_deployment( - std::string_view path, std::vector&& armies, std::vector&& navies, std::vector&& leaders + std::string_view path, std::vector&& armies, std::vector&& navies, std::vector&& leaders ); bool load_oob_file( -- cgit v1.2.3-56-ga3b1