From 37cdd775ac738b2a1264e32471385376e5a34f3a Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 3 Jun 2024 23:39:34 +0100 Subject: Province const/mutable separation + State cleanup --- src/openvic-simulation/military/Deployment.hpp | 29 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 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 8966397..6f4c21f 100644 --- a/src/openvic-simulation/military/Deployment.hpp +++ b/src/openvic-simulation/military/Deployment.hpp @@ -4,26 +4,30 @@ #include #include -#include "openvic-simulation/dataloader/Dataloader.hpp" -#include "openvic-simulation/map/Province.hpp" #include "openvic-simulation/military/Leader.hpp" -#include "openvic-simulation/military/UnitType.hpp" +#include "openvic-simulation/types/HasIdentifier.hpp" +#include "openvic-simulation/utility/Getters.hpp" namespace OpenVic { + struct ProvinceDefinition; + struct RegimentType; + struct RegimentDeployment { friend struct DeploymentManager; private: std::string PROPERTY(name); RegimentType const& PROPERTY(type); - Province const* PROPERTY(home); + ProvinceDefinition const* PROPERTY(home); - RegimentDeployment(std::string_view new_name, RegimentType const& new_type, Province const* new_home); + RegimentDeployment(std::string_view new_name, RegimentType const& new_type, ProvinceDefinition const* new_home); public: RegimentDeployment(RegimentDeployment&&) = default; }; + struct ShipType; + struct ShipDeployment { friend struct DeploymentManager; @@ -42,11 +46,11 @@ namespace OpenVic { private: std::string PROPERTY(name); - Province const* PROPERTY(location); + ProvinceDefinition const* PROPERTY(location); std::vector PROPERTY(regiments); ArmyDeployment( - std::string_view new_name, Province const* new_location, std::vector&& new_regiments + std::string_view new_name, ProvinceDefinition const* new_location, std::vector&& new_regiments ); public: @@ -58,10 +62,12 @@ namespace OpenVic { private: std::string PROPERTY(name); - Province const* PROPERTY(location); + ProvinceDefinition const* PROPERTY(location); std::vector PROPERTY(ships); - NavyDeployment(std::string_view new_name, Province const* new_location, std::vector&& new_ships); + NavyDeployment( + std::string_view new_name, ProvinceDefinition const* new_location, std::vector&& new_ships + ); public: NavyDeployment(NavyDeployment&&) = default; @@ -84,6 +90,9 @@ namespace OpenVic { Deployment(Deployment&&) = default; }; + struct GameManager; + class Dataloader; + struct DeploymentManager { private: IdentifierRegistry IDENTIFIER_REGISTRY(deployment); @@ -102,4 +111,4 @@ namespace OpenVic { size_t get_missing_oob_file_count() const; }; -} // namespace OpenVic +} -- cgit v1.2.3-56-ga3b1