aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/politics/NationalValue.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-10-17 00:37:21 +0200
committer GitHub <noreply@github.com>2023-10-17 00:37:21 +0200
commite65646f260360f634cc7d4ff28e7676c766ebcd8 (patch)
treebe293fe4b4597b74c9d35143a551a8fb33f80290 /src/openvic-simulation/politics/NationalValue.hpp
parentfe319098e49c9841219a9e118a30ebef05eb2c51 (diff)
parentf4f41b6c51ce7a1d719759128b2af92604df5182 (diff)
Merge pull request #54 from OpenVicProject/national-values-loading
Implement National Values Loading
Diffstat (limited to 'src/openvic-simulation/politics/NationalValue.hpp')
-rw-r--r--src/openvic-simulation/politics/NationalValue.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/openvic-simulation/politics/NationalValue.hpp b/src/openvic-simulation/politics/NationalValue.hpp
new file mode 100644
index 0000000..09ef85e
--- /dev/null
+++ b/src/openvic-simulation/politics/NationalValue.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "openvic-simulation/Modifier.hpp"
+#include "openvic-simulation/types/IdentifierRegistry.hpp"
+
+namespace OpenVic {
+ struct NationalValueManager;
+
+ struct NationalValue : HasIdentifier {
+ friend struct NationalValueManager;
+
+ private:
+ const ModifierValue modifiers;
+
+ NationalValue(std::string_view new_identifier, ModifierValue&& new_modifiers);
+
+ public:
+ NationalValue(NationalValue&&) = default;
+
+ ModifierValue const& get_modifiers() const;
+ };
+
+ struct NationalValueManager {
+ private:
+ IdentifierRegistry<NationalValue> national_values;
+
+ public:
+ NationalValueManager();
+
+ bool add_national_value(std::string_view identifier, ModifierValue&& modifiers);
+ IDENTIFIER_REGISTRY_ACCESSORS(national_value)
+
+ bool load_national_values_file(ModifierManager const& modifier_manager, ast::NodeCPtr root);
+ };
+} // namespace OpenVic