public int DeclareNode(BehaviourTreeNode <TBlackboard> node)
        {
            var index = NodesCount;

            _nodes.Add(node);
            return(index);
        }
        public int DeclareVariable(BehaviourTreeNode <TBlackboard> node, string name)
        {
            var definition = new VariableDefinition(node, name);
            var index      = VariablesCount;

            _variableDefinitions.Add(definition);
            return(index);
        }
        private void AcceptNode(BehaviourTreeNode <TBlackboard> node)
        {
            if (_parentNode != null)
            {
                var decorator = _parentNode as BaseDecoratorNode <TBlackboard>;
                var group     = _parentNode as CompositeNode <TBlackboard>;

                if (decorator != null)
                {
                    decorator.Node = node;
                }
                else
                {
                    group?.AddChild(node);
                }
            }
            _node = node;
        }
Exemple #4
0
 public void SetStatus(BehaviourTreeNode <TBlackboard> node, BehaviourTreeStatus status)
 {
     Statuses[node.Id] = status;
 }
Exemple #5
0
 public BehaviourTreeStatus GetStatus(BehaviourTreeNode <TBlackboard> node)
 {
     return(Statuses[node.Id]);
 }
Exemple #6
0
 public BehaviourTreeBuilderFinalizer(BehaviourTreeNode <TBlackboard> node)
 {
     _node = node;
 }
Exemple #7
0
 public BehaviourTreeBuilderNodeFinalizer(TParent parent, BehaviourTreeNode <TBlackboard> node)
 {
     _parent = parent;
     _node   = node;
 }
Exemple #8
0
 public void AddChild(BehaviourTreeNode <TBlackboard> child)
 {
     _children.Add(child);
 }
 public TBuilderMethodResult Splice(BehaviourTreeNode <TBlackboard> node)
 {
     AcceptNode(node);
     return(GetBuilderMethodResult());
 }
 protected abstract void AcceptNode(BehaviourTreeNode <TBlackboard> node);
 public SimpleBehaviourTreeBuilder(SimpleBehaviourTreeBuilder <TBlackboard> parentBuilder, BehaviourTreeNode <TBlackboard> parentNode)
 {
     _parentBuilder = parentBuilder;
     _parentNode    = parentNode;
 }
 public BehaviourTreeMetadata(BehaviourTreeNode <TBlackboard> root)
 {
     root.DeclareNode(this);
     _pool = new BehaviourTreeExecutionData <TBlackboard> .Pool(this);
 }
 public VariableDefinition(BehaviourTreeNode <TBlackboard> owner, string name)
 {
     Owner = owner;
     Name  = name;
 }