aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Decision.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/misc/Decision.hpp')
-rw-r--r--src/openvic-simulation/misc/Decision.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/openvic-simulation/misc/Decision.hpp b/src/openvic-simulation/misc/Decision.hpp
new file mode 100644
index 0000000..e477f64
--- /dev/null
+++ b/src/openvic-simulation/misc/Decision.hpp
@@ -0,0 +1,47 @@
+#pragma once
+
+#include "openvic-simulation/types/IdentifierRegistry.hpp"
+
+namespace OpenVic {
+ struct DecisionManager;
+
+ struct Decision : HasIdentifier {
+ friend struct DecisionManager;
+
+ private:
+ const bool PROPERTY_CUSTOM_PREFIX(alert, has);
+ const bool PROPERTY_CUSTOM_PREFIX(news, is);
+ const std::string PROPERTY(news_title);
+ const std::string PROPERTY(news_desc_long);
+ const std::string PROPERTY(news_desc_medium);
+ const std::string PROPERTY(news_desc_short);
+ const std::string PROPERTY(picture);
+
+ Decision(
+ std::string_view new_identifier, bool new_alert, bool new_news,
+ std::string_view new_news_title, std::string_view new_news_desc_long,
+ std::string_view new_news_desc_medium, std::string_view new_news_desc_short,
+ std::string_view new_picture
+ );
+
+ public:
+ Decision(Decision&&) = default;
+ };
+
+ struct DecisionManager {
+ private:
+ IdentifierRegistry<Decision> decisions;
+
+ public:
+ DecisionManager();
+
+ bool add_decision(
+ std::string_view identifier, bool alert, bool news, std::string_view news_title,
+ std::string_view news_desc_long, std::string_view news_desc_medium,
+ std::string_view news_desc_short, std::string_view picture
+ );
+ IDENTIFIER_REGISTRY_ACCESSORS(decision)
+
+ bool load_decision_file(ast::NodeCPtr root);
+ };
+}