FluentBehaviourTree.BehaviourTreeBuilder.Splice C# (CSharp) Method

Splice() public method

Splice a sub tree into the parent tree.
public Splice ( IBehaviourTreeNode subTree ) : BehaviourTreeBuilder
subTree IBehaviourTreeNode
return BehaviourTreeBuilder
        public BehaviourTreeBuilder Splice(IBehaviourTreeNode subTree)
        {
            if (subTree == null)
            {
                throw new ArgumentNullException("subTree");
            }

            if (parentNodeStack.Count <= 0)
            {
                throw new ApplicationException("Can't splice an unnested sub-tree, there must be a parent-tree.");
            }

            parentNodeStack.Peek().AddChild(subTree);
            return this;
        }