public override void Update(float time) { base.Update(time); if (ChildContext == null) { if ((bool)iterator.GetSuffix("END")) { State = ExecutionState.DONE; ParentContext.RemoveVariable(iteratorString); } else { var iteratorVariable = ParentContext.FindOrCreateVariable(iteratorString); iteratorVariable.Value = iterator.GetSuffix("VALUE"); ChildContext = targetCommand; //ChildContext = Command.Get(commandString, this); ((Command)ChildContext).Evaluate(); } } else { if (ChildContext != null && ChildContext.State == ExecutionState.DONE) { ChildContext = null; } } }
public override void Evaluate() { targetVariable = ParentContext.FindOrCreateVariable(RegexMatch.Groups[1].Value); targetCommand = Command.Get(RegexMatch.Groups[2].Value, ParentContext); if (!objToBool(targetVariable.Value, out originalValue)) { throw new Exception("Value type error"); } ParentContext.Lock(this); State = ExecutionState.DONE; }