public override void Update(float time) { if (triggered) { targetCommand.Update(time); if (targetCommand.State == ExecutionState.DONE) { ParentContext.Unlock(this); } } else if (expression.IsTrue()) { triggered = true; targetCommand.Evaluate(); } }
public override void Evaluate() { expression = new Expression(RegexMatch.Groups[1].Value, ParentContext); targetCommand = Command.Get(RegexMatch.Groups[2].Value, this); if (expression.IsTrue()) { targetCommand.Evaluate(); Push(targetCommand); State = ExecutionState.WAIT; } else { State = ExecutionState.DONE; } }
private void EvaluateNextCommand() { if (this.ChildContext == null) { if (commands.Count > 0) { Command cmd = commands[0]; commands.RemoveAt(0); ChildContext = cmd; cmd.Evaluate(); } else { State = ExecutionState.DONE; } } }
public override void Evaluate() { expression = new Expression(RegexMatch.Groups[1].Value, ParentContext); int numLinesChild = Utils.NewLineCount(Input.Substring(0, RegexMatch.Groups[2].Index)); targetCommand = Get(RegexMatch.Groups[2].Value, this, Line + numLinesChild); if (expression.IsTrue()) { targetCommand.Evaluate(); Push(targetCommand); State = ExecutionState.WAIT; } else { State = ExecutionState.DONE; } }
public override void Update(float time) { bool newValue; if (!objToBool(targetVariable.Value, out newValue)) { ParentContext.Unlock(this); throw new Exception("Value type error"); } if (originalValue != newValue) { ParentContext.Unlock(this); targetCommand.Evaluate(); ParentContext.Push(targetCommand); } }