diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-23 00:17:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 00:17:10 +0200 |
commit | d7022294d43a0b173de4f060e3260e986f03853d (patch) | |
tree | 2e7f7c6919302c66f266a1d4f1c985e8aac6d4a2 /src/openvic-simulation/politics/Ideology.hpp | |
parent | d8e91c095251957cbd9daf06e25fe33c405328e3 (diff) | |
parent | 6178b71675062b56d1b99b4df3329eeced31cd28 (diff) |
Merge pull request #21 from OpenVicProject/dataloading-politics
Dataloading for politics (Ideology & Issue)
Diffstat (limited to 'src/openvic-simulation/politics/Ideology.hpp')
-rw-r--r-- | src/openvic-simulation/politics/Ideology.hpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/openvic-simulation/politics/Ideology.hpp b/src/openvic-simulation/politics/Ideology.hpp new file mode 100644 index 0000000..b72c176 --- /dev/null +++ b/src/openvic-simulation/politics/Ideology.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include "types/Date.hpp" +#include "types/IdentifierRegistry.hpp" +#include "dataloader/NodeTools.hpp" + +namespace OpenVic { + struct IdeologyManager; + + struct IdeologyGroup : HasIdentifier { + friend struct IdeologyManager; + + private: + IdeologyGroup(const std::string_view new_identifier); + + public: + IdeologyGroup(IdeologyGroup&&) = default; + }; + + struct Ideology : HasIdentifierAndColour { + friend struct IdeologyManager; + + private: + IdeologyGroup const& group; + const bool uncivilised; + const Date spawn_date; + + //TODO - willingness to repeal/pass reforms (and its modifiers) + + Ideology(const std::string_view new_identifier, colour_t new_colour, IdeologyGroup const& new_group, bool uncivilised, Date spawn_date); + + public: + Ideology(Ideology&&) = default; + IdeologyGroup const& get_group() const; + bool is_uncivilised() const; + Date const& get_spawn_date() const; + }; + + struct IdeologyManager { + private: + IdentifierRegistry<IdeologyGroup> ideology_groups; + IdentifierRegistry<Ideology> ideologies; + + public: + IdeologyManager(); + + bool add_ideology_group(const std::string_view identifier); + IDENTIFIER_REGISTRY_ACCESSORS(IdeologyGroup, ideology_group) + + bool add_ideology(const std::string_view identifier, colour_t colour, IdeologyGroup const* group, bool uncivilised, Date spawn_date); + IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(Ideology, ideology, ideologies) + + bool load_ideology_file(ast::NodeCPtr root); + }; +}
\ No newline at end of file |