From 33787f89686cd03a6ae7305bc51add5ac47fbde2 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Tue, 19 Sep 2023 21:58:29 +0200 Subject: feat: added PartyIssue and PoliticalReform structs --- .../politics/PoliticalReform.hpp | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/openvic-simulation/politics/PoliticalReform.hpp (limited to 'src/openvic-simulation/politics/PoliticalReform.hpp') diff --git a/src/openvic-simulation/politics/PoliticalReform.hpp b/src/openvic-simulation/politics/PoliticalReform.hpp new file mode 100644 index 0000000..7c778d1 --- /dev/null +++ b/src/openvic-simulation/politics/PoliticalReform.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include +#include "types/IdentifierRegistry.hpp" + +namespace OpenVic { + struct PoliticalReformManager; + + struct PoliticalReformGroup : HasIdentifier { + friend struct PoliticalReformManager; + + private: + PoliticalReformGroup(const std::string_view new_identifier, bool ordered); + const bool ordered; //next_step_only, TODO default to false + + public: + PoliticalReformGroup(PoliticalReformGroup&&) = default; + bool is_ordered() const; + }; + + struct PoliticalReform : HasIdentifier { + friend struct PoliticalReformManager; + + private: + PoliticalReformGroup const& group; + const size_t ordinal; //assigned by the parser to allow policy sorting + + //TODO - conditions to allow, policy modifiers, policy rule changes + + PoliticalReform(const std::string_view new_identifier, PoliticalReformGroup const& new_group, size_t ordinal); + + public: + PoliticalReform(PoliticalReform&&) = default; + size_t get_ordinal() const; + }; + + struct PoliticalReformManager { + private: + IdentifierRegistry political_reform_groups; + IdentifierRegistry political_reforms; + + public: + PoliticalReformManager(); + + bool add_political_reform_group(const std::string_view identifier, bool ordered); + IDENTIFIER_REGISTRY_ACCESSORS(PoliticalReformGroup, political_reform_group) + + bool add_political_reform(const std::string_view identifier, PoliticalReformGroup const* group, size_t ordinal); + IDENTIFIER_REGISTRY_ACCESSORS(PoliticalReform, political_reform) + + //TODO - loaders + }; +} \ No newline at end of file -- cgit v1.2.3-56-ga3b1