diff options
author | Hop311 <Hop3114@gmail.com> | 2024-06-13 18:59:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 18:59:47 +0200 |
commit | bfd539513af435564daf70f94f6cce146dd5c948 (patch) | |
tree | 7ba5a06714c267185dd3a59aabc6556a105c122f /src/openvic-simulation/misc/Event.cpp | |
parent | 01a8f60aaca9784d814f4cb35a3fc4be86e1dd20 (diff) | |
parent | 4b39e77304094708d5c503b6a221386408cc4409 (diff) |
Merge pull request #165 from OpenVicProject/instance-definition-managers
Separated GameManager into Definition and Instance Managers
Diffstat (limited to 'src/openvic-simulation/misc/Event.cpp')
-rw-r--r-- | src/openvic-simulation/misc/Event.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/openvic-simulation/misc/Event.cpp b/src/openvic-simulation/misc/Event.cpp index 2617927..5bfc929 100644 --- a/src/openvic-simulation/misc/Event.cpp +++ b/src/openvic-simulation/misc/Event.cpp @@ -9,10 +9,10 @@ using namespace OpenVic::NodeTools; Event::EventOption::EventOption(std::string_view new_name, EffectScript&& new_effect, ConditionalWeight&& new_ai_chance) : name { new_name }, effect { std::move(new_effect) }, ai_chance { std::move(new_ai_chance) } {} -bool Event::EventOption::parse_scripts(GameManager& game_manager) { +bool Event::EventOption::parse_scripts(DefinitionManager const& definition_manager) { bool ret = true; - ret &= effect.parse_script(false, game_manager); - ret &= ai_chance.parse_scripts(game_manager); + ret &= effect.parse_script(false, definition_manager); + ret &= ai_chance.parse_scripts(definition_manager); return ret; } @@ -31,13 +31,13 @@ Event::Event( mean_time_to_happen { std::move(new_mean_time_to_happen) }, immediate { std::move(new_immediate) }, options { std::move(new_options) } {} -bool Event::parse_scripts(GameManager& game_manager) { +bool Event::parse_scripts(DefinitionManager const& definition_manager) { bool ret = true; - ret &= trigger.parse_script(true, game_manager); - ret &= mean_time_to_happen.parse_scripts(game_manager); - ret &= immediate.parse_script(true, game_manager); + ret &= trigger.parse_script(true, definition_manager); + ret &= mean_time_to_happen.parse_scripts(definition_manager); + ret &= immediate.parse_script(true, definition_manager); for (EventOption& option : options) { - ret &= option.parse_scripts(game_manager); + ret &= option.parse_scripts(definition_manager); } return ret; } @@ -229,10 +229,10 @@ bool EventManager::load_on_action_file(ast::NodeCPtr root) { return ret; } -bool EventManager::parse_scripts(GameManager& game_manager) { +bool EventManager::parse_scripts(DefinitionManager const& definition_manager) { bool ret = true; for (Event& event : events.get_items()) { - ret &= event.parse_scripts(game_manager); + ret &= event.parse_scripts(definition_manager); } return ret; } |