public override void Update(float time) { base.Update(time); if (ChildContext == null) { if (waitExpression.IsTrue()) { State = ExecutionState.DONE; } else { ChildContext = targetCommand; //ChildContext = Command.Get(commandString, this); ((Command)ChildContext).Evaluate(); } } else { if (ChildContext != null && ChildContext.State == ExecutionState.DONE) { ChildContext = null; } } }
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; } }
public override void Update(float time) { if (waitExpression != null) { if (waitExpression.IsTrue()) { State = ExecutionState.DONE; } } else if (waitTime > 0) { waitTime -= time; if (waitTime <= 0) { 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; } }