aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/scripts/ConditionScript.cpp
blob: 368054b2a3d0faaee4265d137ece8db65e81c015 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "ConditionScript.hpp"

#include "openvic-simulation/GameManager.hpp"

using namespace OpenVic;
using namespace OpenVic::NodeTools;

ConditionScript::ConditionScript(
   scope_t new_initial_scope, scope_t new_this_scope, scope_t new_from_scope
) : initial_scope { new_initial_scope }, this_scope { new_this_scope }, from_scope { new_from_scope } {}

bool ConditionScript::_parse_script(ast::NodeCPtr root, GameManager const& game_manager) {
   return game_manager.get_script_manager().get_condition_manager().expect_condition_script(
      game_manager,
      initial_scope,
      this_scope,
      from_scope,
      move_variable_callback(condition_root)
   )(root);
}