#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 { private: std::string PROPERTY(name); RegimentType const* PROPERTY(type); Province const* PROPERTY(home); public: RegimentDeployment(std::string_view new_name, RegimentType const* new_type, Province const* new_home); }; struct ShipDeployment { private: std::string PROPERTY(name); ShipType const* PROPERTY(type); public: ShipDeployment(std::string_view new_name, ShipType const* new_type); }; struct ArmyDeployment { private: std::string PROPERTY(name); Province const* PROPERTY(location); std::vector PROPERTY(regiments); public: ArmyDeployment(std::string_view new_name, Province const* new_location, std::vector&& new_regiments); }; struct NavyDeployment { private: std::string PROPERTY(name); Province const* PROPERTY(location); std::vector PROPERTY(ships); public: 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&& ); 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: IdentifierInstanceRegistry 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