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.Expression(RegexMatch.Groups[1].Value, ParentContext); var 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) { return; } ParentContext.Unlock(this); targetCommand.Evaluate(); ParentContext.Push(targetCommand); }