Runs childs nodes in parallel.
상속: IParentBehaviourTreeNode
        /// <summary>
        /// Create a parallel node.
        /// </summary>
        public BehaviourTreeBuilder Parallel(string name, int numRequiredToFail, int numRequiredToSucceed)
        {
            var parallelNode = new ParallelNode(name, numRequiredToFail, numRequiredToSucceed);

            if (parentNodeStack.Count > 0)
            {
                parentNodeStack.Peek().AddChild(parallelNode);
            }

            parentNodeStack.Push(parallelNode);
            return(this);
        }
        /// <summary>
        /// Create a parallel node.
        /// </summary>
        public BehaviourTreeBuilder Parallel(int numRequiredToFail, int numRequiredToSucceed)
        {
            var id           = ++_idCounter;
            var parallelNode = new ParallelNode(id, numRequiredToFail, numRequiredToSucceed);

            if (_parentNodeStack.Count > 0)
            {
                _parentNodeStack.Peek().AddChild(parallelNode);
            }

            _parentNodeStack.Push(parallelNode);
            return(this);
        }
예제 #3
0
        /// <summary>
        /// Create a parallel node.
        /// </summary>
        public BehaviourTreeBuilder <T> Parallel(string name, int numRequiredToFail, int numRequiredToSucceed)
        {
            int id           = ++_idCounter;
            var parallelNode = new ParallelNode <T>(name, id, numRequiredToFail, numRequiredToSucceed)
            {
                IsDisabled = IsBlacklisted(id)
            };

            if (_parentNodeStack.Count > 0)
            {
                _parentNodeStack.Peek().AddChild(parallelNode);
            }

            _parentNodeStack.Push(parallelNode);
            return(this);
        }
 void Init(int numRequiredToFail = 0, int numRequiredToSucceed = 0)
 {
     testObject = new ParallelNode("some-parallel", numRequiredToFail, numRequiredToSucceed);
 }
        /// <summary>
        /// Create a parallel node.
        /// </summary>
        public BehaviourTreeBuilder Parallel(string name, int numRequiredToFail, int numRequiredToSucceed)
        {
            var parallelNode = new ParallelNode(name, numRequiredToFail, numRequiredToSucceed);

            if (parentNodeStack.Count > 0)
            {
                parentNodeStack.Peek().AddChild(parallelNode);
            }

            parentNodeStack.Push(parallelNode);
            return this;
        }