示例#1
0
        public SimpleBehaviourTree()
        {
            @lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            TreeTraversalStrategy = new BFSTraversal <HashSet <BTNode> >();
            RootNode  = new RootNode("Root Node");
            TreeNodes = new HashSet <string>
            {
                RootNode.Name
            };
        }
示例#2
0
        public BTStatus Execute()
        {
            Logger.Info("Started Behaviour Tree");

            /*
             * To properly start all nodes we need to explore the tree using Breadth First Search
             */
            var traverser = new BFSTraversal <HashSet <BTNode> >();

            foreach (var node in traverser.Traverse(this))
            {
                Logger.Info($"Ticking {node}");
                node.Tick();
            }

            return(TreeStatus);
        }