aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics/Ideology.hpp
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-09-19 19:26:22 +0200
committer zaaarf <zaaarf@proton.me>2023-09-19 19:26:22 +0200
commitb1349e8dfa0c840ca82472fb7f342de08ed8804b (patch)
tree84333588df23c4ca5da1910f3a259482ebd28fa7 /src/openvic-simulation/politics/Ideology.hpp
parent7a55877367282749e89ff938ca1d7910f7166fe6 (diff)
feat: added Ideology and IdeologyGroup data structures
Diffstat (limited to 'src/openvic-simulation/politics/Ideology.hpp')
-rw-r--r--src/openvic-simulation/politics/Ideology.hpp53
1 files changed, 53 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..b3227f7
--- /dev/null
+++ b/src/openvic-simulation/politics/Ideology.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "types/Date.hpp"
+#include "types/IdentifierRegistry.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;
+ 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)
+
+ //TODO - loaders
+ };
+} \ No newline at end of file