예제 #1
0
 public override void AddChild(BehaviorComponent behaviorComponent)
 {
     if (_behaviors == null)
     {
         _behaviors = new BehaviorComponent[] { }
     }
     ;
     _behaviors = _behaviors.Append(behaviorComponent).ToArray();
 }
        /// <summary>
        /// Splice a sub tree into the parent tree.
        /// </summary>
        public BehaviourTreeBuilder Splice(BehaviorComponent 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);
        }
예제 #3
0
 public override void AddChild(BehaviorComponent behaviorComponent)
 {
     throw new NotImplementedException();
 }
예제 #4
0
 public override void AddChild(BehaviorComponent behaviorComponent)
 {
     _Behavior = behaviorComponent;
 }
 /// <summary>
 /// Ends a sequence of children.
 /// </summary>
 public BehaviourTreeBuilder End()
 {
     curNode = parentNodeStack.Pop();
     return(this);
 }
예제 #6
0
 public void AddBehaviour(BehaviorComponent behaviorComponent)
 {
     _Behaviors = _Behaviors.Append(behaviorComponent).ToArray();
 }