diff options
author | Hop311 <Hop3114@gmail.com> | 2024-01-02 15:40:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-02 15:40:00 +0100 |
commit | 4c8da86c3bede8834f381fa63edaa3e140131f69 (patch) | |
tree | ff3433a63e91b9239eb7226e75054314182d6c1f /src/openvic-simulation/research/Invention.hpp | |
parent | 66b80459c9d49895de902432bce11176b1270878 (diff) | |
parent | 5f64f983d0cead266a28791be42162c443fd2a75 (diff) |
Merge pull request #112 from OpenVicProject/script-framework
Added framework for loading all Conditions and Effects
Diffstat (limited to 'src/openvic-simulation/research/Invention.hpp')
-rw-r--r-- | src/openvic-simulation/research/Invention.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/openvic-simulation/research/Invention.hpp b/src/openvic-simulation/research/Invention.hpp index 5d31155..2b8100d 100644 --- a/src/openvic-simulation/research/Invention.hpp +++ b/src/openvic-simulation/research/Invention.hpp @@ -1,6 +1,7 @@ #pragma once #include "openvic-simulation/misc/Modifier.hpp" +#include "openvic-simulation/scripts/ConditionalWeight.hpp" #include "openvic-simulation/types/IdentifierRegistry.hpp" #include "openvic-simulation/types/OrderedContainers.hpp" @@ -27,13 +28,17 @@ namespace OpenVic { crime_set_t PROPERTY(enabled_crimes); const bool PROPERTY_CUSTOM_PREFIX(unlock_gas_attack, will); const bool PROPERTY_CUSTOM_PREFIX(unlock_gas_defence, will); + ConditionScript PROPERTY(limit); + ConditionalWeight PROPERTY(chance); Invention( std::string_view new_identifier, ModifierValue&& new_values, bool new_news, unit_set_t&& new_activated_units, building_set_t&& new_activated_buildings, crime_set_t&& new_enabled_crimes, bool new_unlock_gas_attack, - bool new_unlock_gas_defence + bool new_unlock_gas_defence, ConditionScript&& new_limit, ConditionalWeight&& new_chance ); + bool parse_scripts(GameManager const& game_manager); + public: Invention(Invention&&) = default; }; @@ -45,12 +50,14 @@ namespace OpenVic { bool add_invention( std::string_view identifier, ModifierValue&& values, bool news, Invention::unit_set_t&& activated_units, Invention::building_set_t&& activated_buildings, Invention::crime_set_t&& enabled_crimes, bool unlock_gas_attack, - bool unlock_gas_defence + bool unlock_gas_defence, ConditionScript&& limit, ConditionalWeight&& chance ); bool load_inventions_file( ModifierManager const& modifier_manager, UnitManager const& unit_manager, BuildingTypeManager const& building_type_manager, CrimeManager const& crime_manager, ast::NodeCPtr root ); // inventions/*.txt + + bool parse_scripts(GameManager const& game_manager); }; }
\ No newline at end of file |