Beispiel #1
0
        public BehaviorTreeBuilder AddNodeWithPointer(ITaskParent task)
        {
            AddNode(task);
            _pointers.Add(task);

            return(this);
        }
 public void CheckUpdateCalls(ITaskParent selector, List <int> updateCalls)
 {
     for (var i = 0; i < updateCalls.Count; i++)
     {
         var child = selector.Children[i];
         if (updateCalls[i] >= 0)
         {
             child.Received(updateCalls[i]).Update();
         }
     }
 }
Beispiel #3
0
        private void SyncNodes(ITaskParent taskParent)
        {
            taskParent.Owner      = _owner;
            taskParent.ParentTree = this;

            foreach (var child in taskParent.Children)
            {
                child.Owner      = _owner;
                child.ParentTree = this;

                var parent = child as ITaskParent;
                if (parent != null)
                {
                    SyncNodes(parent);
                }
            }
        }
Beispiel #4
0
        public void Splice(ITaskParent parent, BehaviorTree tree)
        {
            parent.AddChild(tree.Root);

            SyncNodes(tree.Root);
        }
Beispiel #5
0
 public void AddNode(ITaskParent parent, ITask child)
 {
     parent.AddChild(child);
     child.ParentTree = this;
     child.Owner      = _owner;
 }