aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Decision.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-01-02 15:40:00 +0100
committer GitHub <noreply@github.com>2024-01-02 15:40:00 +0100
commit4c8da86c3bede8834f381fa63edaa3e140131f69 (patch)
treeff3433a63e91b9239eb7226e75054314182d6c1f /src/openvic-simulation/misc/Decision.hpp
parent66b80459c9d49895de902432bce11176b1270878 (diff)
parent5f64f983d0cead266a28791be42162c443fd2a75 (diff)
Merge pull request #112 from OpenVicProject/script-framework
Added framework for loading all Conditions and Effects
Diffstat (limited to 'src/openvic-simulation/misc/Decision.hpp')
-rw-r--r--src/openvic-simulation/misc/Decision.hpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/openvic-simulation/misc/Decision.hpp b/src/openvic-simulation/misc/Decision.hpp
index 32141fe..593b6e4 100644
--- a/src/openvic-simulation/misc/Decision.hpp
+++ b/src/openvic-simulation/misc/Decision.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "openvic-simulation/scripts/ConditionalWeight.hpp"
+#include "openvic-simulation/scripts/EffectScript.hpp"
#include "openvic-simulation/types/IdentifierRegistry.hpp"
namespace OpenVic {
@@ -11,18 +13,25 @@ namespace OpenVic {
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);
+ std::string PROPERTY(news_title);
+ std::string PROPERTY(news_desc_long);
+ std::string PROPERTY(news_desc_medium);
+ std::string PROPERTY(news_desc_short);
+ std::string PROPERTY(picture);
+ ConditionScript PROPERTY(potential);
+ ConditionScript PROPERTY(allow);
+ ConditionalWeight PROPERTY(ai_will_do);
+ EffectScript PROPERTY(effect);
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
+ std::string_view new_picture, ConditionScript&& new_potential, ConditionScript&& new_allow,
+ ConditionalWeight&& new_ai_will_do, EffectScript&& new_effect
);
+ bool parse_scripts(GameManager& game_manager);
+
public:
Decision(Decision&&) = default;
};
@@ -34,9 +43,12 @@ namespace OpenVic {
public:
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
+ std::string_view news_desc_medium, std::string_view news_desc_short, std::string_view picture,
+ ConditionScript&& potential, ConditionScript&& allow, ConditionalWeight&& ai_will_do, EffectScript&& effect
);
bool load_decision_file(ast::NodeCPtr root);
+
+ bool parse_scripts(GameManager& game_manager);
};
}