public ScriptExecutionSession(EventScript script, EventExecutionContext context, Action onFinished, EventRuntimeReferenceHost resolver, IVariableStore temporaryVariables, IVariableStore eventVariables) { Commands = new List <EventCommand>(script.CommandList.Commands); WaitForAllCommands = script.WaitForAllCommands; OnFinished = onFinished; CurrentContext = context; ReferenceResolver = resolver; TemporaryVariables = temporaryVariables; EventVariables = eventVariables; }
private void UpdateLoop(EventExecutionContext context, CommandExecutionHandle handle) { if (condition.Evaluate(context)) { var script = new EventScript(); script.CommandList = routine; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, () => UpdateLoop(context, handle)); } else { handle.Complete(); } }
private void UpdateLoop(EventExecutionContext context, CommandExecutionHandle handle) { counter++; if (count.Evaluate(context, out object result)) { if (result is IComparable resultComparable && counter.CompareTo(resultComparable) < 0) { var script = new EventScript(); script.CommandList = routine; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, () => UpdateLoop(context, handle)); return; } } handle.Complete(); }
public override void Execute(EventExecutionContext context, CommandExecutionHandle handle) { if (condition.Evaluate(context, onFailed)) { var script = new EventScript(); script.CommandList = ifTrue; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, handle.Complete); } else { var script = new EventScript(); script.CommandList = ifFalse; script.WaitForAllCommands = waitForAllCommand; context.InsertInherit(script, handle.Complete); } }