aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/pop/Culture.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-07-28 00:10:46 +0200
committer GitHub <noreply@github.com>2023-07-28 00:10:46 +0200
commit8a08be3e7e8477973e243716d431ad7117acfa43 (patch)
treea91587787bf6742168279ac41f77b9ebabe0dffe /src/openvic/pop/Culture.hpp
parent420c2dce47e74c01ff46be991058d543e0c70a6b (diff)
parent532c9be36ca03ee13c92ca7d895aaf5b42eeb034 (diff)
Merge pull request #9 from OpenVicProject/pops
Pops and other bits
Diffstat (limited to 'src/openvic/pop/Culture.hpp')
-rw-r--r--src/openvic/pop/Culture.hpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/openvic/pop/Culture.hpp b/src/openvic/pop/Culture.hpp
new file mode 100644
index 0000000..971ef71
--- /dev/null
+++ b/src/openvic/pop/Culture.hpp
@@ -0,0 +1,73 @@
+#pragma once
+
+#include "../Types.hpp"
+
+namespace OpenVic {
+
+ struct CultureManager;
+
+ struct GraphicalCultureType : HasIdentifier {
+ friend struct CultureManager;
+
+ private:
+ GraphicalCultureType(std::string const& new_identifier);
+
+ public:
+ GraphicalCultureType(GraphicalCultureType&&) = default;
+ };
+
+ struct CultureGroup : HasIdentifier {
+ friend struct CultureManager;
+
+ private:
+ GraphicalCultureType const& unit_graphical_culture_type;
+
+ // TODO - leader type, union tag
+
+ CultureGroup(std::string const& new_identifier, GraphicalCultureType const& new_unit_graphical_culture_type);
+
+ public:
+ CultureGroup(CultureGroup&&) = default;
+
+ GraphicalCultureType const& get_unit_graphical_culture_type() const;
+ };
+
+ struct Culture : HasIdentifier, HasColour {
+ friend struct CultureManager;
+
+ using name_list_t = std::vector<std::string>;
+
+ private:
+ CultureGroup const& group;
+ const name_list_t first_names, last_names;
+
+ // TODO - radicalism, primary tag
+
+ Culture(CultureGroup const& new_group, std::string const& new_identifier, colour_t new_colour, name_list_t const& new_first_names, name_list_t const& new_last_names);
+
+ public:
+ Culture(Culture&&) = default;
+
+ CultureGroup const& get_group() const;
+ };
+
+ struct CultureManager {
+ private:
+ IdentifierRegistry<GraphicalCultureType> graphical_culture_types;
+ IdentifierRegistry<CultureGroup> culture_groups;
+ IdentifierRegistry<Culture> cultures;
+
+ public:
+ CultureManager();
+
+ return_t add_graphical_culture_type(std::string const& identifier);
+ void lock_graphical_culture_types();
+ GraphicalCultureType const* get_graphical_culture_type_by_identifier(std::string const& identifier) const;
+ return_t add_culture_group(std::string const& identifier, GraphicalCultureType const* new_graphical_culture_type);
+ void lock_culture_groups();
+ CultureGroup const* get_culture_group_by_identifier(std::string const& identifier) const;
+ return_t add_culture(std::string const& identifier, colour_t colour, CultureGroup const* group, Culture::name_list_t const& first_names, Culture::name_list_t const& last_names);
+ void lock_cultures();
+ Culture const* get_culture_by_identifier(std::string const& identifier) const;
+ };
+}