Пример #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);
        }