/// <summary> /// Create a Repeater node with a finite number of iterations. /// </summary> public BehaviourTreeBuilder Repeater(string name, int maxIterations) { var repeaterNode = new RepeaterNode(name, maxIterations); if (parentNodeStack.Count > 0) { parentNodeStack.Peek().AddChild(repeaterNode); } parentNodeStack.Push(repeaterNode); return(this); }
/// <summary> /// Create a Repeater node with a finite number of iterations. /// </summary> public BehaviourTreeBuilder <T> Repeater(string name, int maxIterations) { var repeaterNode = new RepeaterNode <T>(name, ++_idCounter, maxIterations); if (_parentNodeStack.Count > 0) { _parentNodeStack.Peek().AddChild(repeaterNode); } _parentNodeStack.Push(repeaterNode); return(this); }