#pragma once #include #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" namespace OpenVic { struct RegimentDeployment { friend struct DeploymentManager; private: std::string PROPERTY(name); RegimentType const& PROPERTY(type); Province const* PROPERTY(home); RegimentDeployment(std::string_view new_name, RegimentType const& new_type, Province const* new_home); public: RegimentDeployment(RegimentDeployment&&) = default; }; struct ShipDeployment { friend struct DeploymentManager; private: std::string PROPERTY(name); ShipType const& PROPERTY(type); ShipDeployment(std::string_view new_name, ShipType const& new_type); public: ShipDeployment(ShipDeployment&&) = default; }; struct ArmyDeployment { friend struct DeploymentManager; private: std::string PROPERTY(name); Province const* PROPERTY(location); std::vector PROPERTY(regiments); ArmyDeployment( std::string_view new_name, Province const* new_location, std::vector&& new_regiments ); public: ArmyDeployment(ArmyDeployment&&) = default; }; struct NavyDeployment { friend struct DeploymentManager; private: std::string PROPERTY(name); Province const* PROPERTY(location); std::vector PROPERTY(ships); NavyDeployment(std::string_view new_name, Province const* new_location, std::vector&& new_ships); public: NavyDeployment(NavyDeployment&&) = default; }; struct Deployment : HasIdentifier { friend struct DeploymentManager; private: 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::vector&& new_leaders ); public: Deployment(Deployment&&) = default; }; struct DeploymentManager { private: IdentifierRegistry IDENTIFIER_REGISTRY(deployment); string_set_t missing_oob_files; public: bool add_deployment( std::string_view path, std::vector&& armies, std::vector&& navies, std::vector&& leaders ); bool load_oob_file( GameManager const& game_manager, Dataloader const& dataloader, std::string_view history_path, Deployment const*& deployment, bool fail_on_missing ); size_t get_missing_oob_file_count() const; }; } // namespace OpenVic