aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Event.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-06-13 00:24:00 +0200
committer hop311 <hop3114@gmail.com>2024-06-13 00:24:00 +0200
commit4b39e77304094708d5c503b6a221386408cc4409 (patch)
tree7ba5a06714c267185dd3a59aabc6556a105c122f /src/openvic-simulation/misc/Event.cpp
parentc0ba822ee46551a40ad6b43e8f56b80e27ae35b5 (diff)
Separated GameManager into Definition and Instance Managersinstance-definition-managers
Diffstat (limited to 'src/openvic-simulation/misc/Event.cpp')
-rw-r--r--src/openvic-simulation/misc/Event.cpp20
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;
}