Ejemplo n.º 1
0
        public void Compilation(IEnumerable <IBehaviourTreeNode <int, int> > nodes, bool success)
        {
            var parallelNode = new ParallelNode <int, int>("test", 1, 1);

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

            if (success)
            {
                var func = parallelNode.Compile();

                Assert.NotNull(func);
            }
            else
            {
                Assert.Throws <BehaviourTreeCompilationException>(() => parallelNode.Compile());
            }
        }
Ejemplo n.º 2
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));
        }