From c9c198e3b47e84eaea998cd9d2f7a8aa2b50ce73 Mon Sep 17 00:00:00 2001 From: Joel Machens Date: Mon, 16 Oct 2023 21:43:40 -0500 Subject: Country History & Order of Battle Loading --- src/openvic-simulation/military/Deployment.hpp | 79 ++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/openvic-simulation/military/Deployment.hpp (limited to 'src/openvic-simulation/military/Deployment.hpp') diff --git a/src/openvic-simulation/military/Deployment.hpp b/src/openvic-simulation/military/Deployment.hpp new file mode 100644 index 0000000..8ec0e49 --- /dev/null +++ b/src/openvic-simulation/military/Deployment.hpp @@ -0,0 +1,79 @@ +#pragma once + +#include +#include +#include +#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" + +namespace OpenVic { + struct Leader { + std::string name; + const Unit::type_t type; + const Date date; + LeaderTrait const* personality; + LeaderTrait const* background; + fixed_point_t prestige; + }; + + struct Regiment { + std::string name; + Unit const* type; + Province const* home; + }; + + struct Ship { + std::string name; + Unit const* type; + }; + + struct Army { + std::string name; + Province const* location; + std::vector regiments; + }; + + struct Navy { + std::string name; + Province const* location; + std::vector ships; + }; + + struct DeploymentManager; + + struct Deployment : HasIdentifier { + friend struct DeploymentManager; + + private: + const std::vector armies; + const std::vector navies; + const std::vector leaders; + + Deployment(std::string_view new_path, std::vector&& new_armies, std::vector&& new_navies, std::vector&& new_leaders); + + public: + const std::vector& get_armies() const; + const std::vector& get_navies() const; + const std::vector& get_leaders() const; + }; + + struct DeploymentManager { + private: + IdentifierRegistry deployments; + + public: + DeploymentManager(); + + bool add_deployment(std::string_view path, std::vector&& armies, std::vector&& navies, std::vector&& leaders); + IDENTIFIER_REGISTRY_ACCESSORS(deployment); + + bool load_oob_file(GameManager& game_manager, std::string_view path, ast::NodeCPtr root); + }; +} // namespace OpenVic -- cgit v1.2.3-56-ga3b1