예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }