aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/scripts/ConditionalWeight.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/scripts/ConditionalWeight.cpp
parentc0ba822ee46551a40ad6b43e8f56b80e27ae35b5 (diff)
Separated GameManager into Definition and Instance Managersinstance-definition-managers
Diffstat (limited to 'src/openvic-simulation/scripts/ConditionalWeight.cpp')
-rw-r--r--src/openvic-simulation/scripts/ConditionalWeight.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/openvic-simulation/scripts/ConditionalWeight.cpp b/src/openvic-simulation/scripts/ConditionalWeight.cpp
index e5bb7d0..7c3e0a0 100644
--- a/src/openvic-simulation/scripts/ConditionalWeight.cpp
+++ b/src/openvic-simulation/scripts/ConditionalWeight.cpp
@@ -7,7 +7,9 @@ ConditionalWeight::ConditionalWeight(scope_t new_initial_scope, scope_t new_this
: initial_scope { new_initial_scope }, this_scope { new_this_scope }, from_scope { new_from_scope } {}
template<typename T>
-static NodeCallback auto expect_modifier(std::vector<T>& items, scope_t initial_scope, scope_t this_scope, scope_t from_scope) {
+static NodeCallback auto expect_modifier(
+ std::vector<T>& items, scope_t initial_scope, scope_t this_scope, scope_t from_scope
+) {
return [&items, initial_scope, this_scope, from_scope](ast::NodeCPtr node) -> bool {
fixed_point_t weight = 0;
bool successful = false;
@@ -46,10 +48,10 @@ node_callback_t ConditionalWeight::expect_conditional_weight(base_key_t base_key
}
struct ConditionalWeight::parse_scripts_visitor_t {
- GameManager const& game_manager;
+ DefinitionManager const& definition_manager;
bool operator()(condition_weight_t& condition_weight) const {
- return condition_weight.second.parse_script(false, game_manager);
+ return condition_weight.second.parse_script(false, definition_manager);
}
bool operator()(condition_weight_item_t& item) const {
return std::visit(*this, item);
@@ -64,6 +66,6 @@ struct ConditionalWeight::parse_scripts_visitor_t {
}
};
-bool ConditionalWeight::parse_scripts(GameManager const& game_manager) {
- return parse_scripts_visitor_t { game_manager }(condition_weight_items);
+bool ConditionalWeight::parse_scripts(DefinitionManager const& definition_manager) {
+ return parse_scripts_visitor_t { definition_manager }(condition_weight_items);
}