ArkScript
A small, fast, functional and scripting language for video games
Pipeline.cpp
Go to the documentation of this file.
2 
3 namespace Ark::internal
4 {
5  MacroExecutorPipeline::MacroExecutorPipeline(const std::vector<std::shared_ptr<MacroExecutor>>& executors) :
6  m_executors(executors)
7  {}
8 
10  {
11  for (const std::shared_ptr<MacroExecutor>& executor : m_executors)
12  {
13  if (executor->canHandle(node))
14  {
15  if (executor->applyMacro(node))
16  return true;
17  }
18  }
19  return false;
20  }
21 }
The Chain of Responsibility class for running nodes through MacroExecutors.
bool applyMacro(Node &node)
Passes node through all MacroExecutors sequentially.
Definition: Pipeline.cpp:9
std::vector< std::shared_ptr< MacroExecutor > > m_executors
Definition: Pipeline.hpp:50
A node of an Abstract Syntax Tree for ArkScript.
Definition: Node.hpp:29