Ejemplo n.º 1
0
        public BehaviorTreeBuilder AddNodeWithPointer(ITaskParent task)
        {
            AddNode(task);
            _pointers.Add(task);

            return(this);
        }
Ejemplo n.º 2
0
 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();
         }
     }
 }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 4
0
        public void Splice(ITaskParent parent, BehaviorTree tree)
        {
            parent.AddChild(tree.Root);

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