aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/Deployment.hpp
diff options
context:
space:
mode:
author Joel Machens <ajmach6@gmail.com>2023-10-17 04:43:40 +0200
committer Joel Machens <ajmach6@gmail.com>2023-10-25 02:17:45 +0200
commitc9c198e3b47e84eaea998cd9d2f7a8aa2b50ce73 (patch)
treebd5fba638a55c683e587eb5e2bbde43ab5fb1a00 /src/openvic-simulation/military/Deployment.hpp
parent7bda541557722b2a244e80796c612b735d8b5cf7 (diff)
Country History & Order of Battle Loading
Diffstat (limited to 'src/openvic-simulation/military/Deployment.hpp')
-rw-r--r--src/openvic-simulation/military/Deployment.hpp79
1 files changed, 79 insertions, 0 deletions
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 <filesystem>
+#include <string>
+#include <string_view>
+#include <vector>
+
+#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<Regiment> regiments;
+ };
+
+ struct Navy {
+ std::string name;
+ Province const* location;
+ std::vector<Ship> ships;
+ };
+
+ struct DeploymentManager;
+
+ struct Deployment : HasIdentifier {
+ friend struct DeploymentManager;
+
+ private:
+ const std::vector<Army> armies;
+ const std::vector<Navy> navies;
+ const std::vector<Leader> leaders;
+
+ Deployment(std::string_view new_path, std::vector<Army>&& new_armies, std::vector<Navy>&& new_navies, std::vector<Leader>&& new_leaders);
+
+ public:
+ const std::vector<Army>& get_armies() const;
+ const std::vector<Navy>& get_navies() const;
+ const std::vector<Leader>& get_leaders() const;
+ };
+
+ struct DeploymentManager {
+ private:
+ IdentifierRegistry<Deployment> deployments;
+
+ public:
+ DeploymentManager();
+
+ bool add_deployment(std::string_view path, std::vector<Army>&& armies, std::vector<Navy>&& navies, std::vector<Leader>&& leaders);
+ IDENTIFIER_REGISTRY_ACCESSORS(deployment);
+
+ bool load_oob_file(GameManager& game_manager, std::string_view path, ast::NodeCPtr root);
+ };
+} // namespace OpenVic