コード例 #1
0
        public void ExecutionResult(IBehaviourTreeNode <int, int> node, BehaviourTreeState expectedState)
        {
            var invert = new SucceederNode <int, int>();

            invert.Decorate(node);

            var func  = invert.Compile();
            var state = func(0, 0);

            Assert.Equal(expectedState, state);
        }
コード例 #2
0
        public void VerifyExecution(IEnumerable <IBehaviourTreeNode <int, int> > nodes, BehaviourTreeState expectedState)
        {
            var selectNode = new RandomSelectNode <int, int>("test");

            foreach (var node in nodes)
            {
                selectNode.AddNode(node, 1);
            }

            var func = selectNode.Compile();

            var state = func(0, 0);

            Assert.Equal(expectedState, state);
        }
コード例 #3
0
 public void LogExecutedAction(string actionName, T1 tick, BehaviourTreeState nodeState)
 {
     _log.Add("executed [" + actionName + "]");
 }
コード例 #4
0
 public void Run(ref T agent, ref BehaviourTreeState state)
 {
     root.Run(ref agent, state.NodeStates);
 }
コード例 #5
0
        public void Execution(IEnumerable <IBehaviourTreeNode <int, int> > nodes, int successCount, int failureCount, BehaviourTreeState expectedState)
        {
            var parallelNode = new ParallelNode <int, int>("test", successCount, failureCount);

            foreach (var node in nodes)
            {
                parallelNode.AddNode(node);
            }

            var func = parallelNode.Compile();

            Assert.Equal(expectedState, func(1, 1));
        }