diff options
author | hop311 <hop3114@gmail.com> | 2023-12-31 01:47:31 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-02 14:41:28 +0100 |
commit | 5f64f983d0cead266a28791be42162c443fd2a75 (patch) | |
tree | da5fbb48d6c01d6faedd16b46ff846c65fdb4c33 /src/openvic-simulation/misc/Decision.hpp | |
parent | 9988b21278dc1c8df044631bd2935a7e450a7bff (diff) |
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.hpp | 26 |
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); }; } |