Ejemplo n.º 1
0
        public void TestTick2()
        {
            SequenceNode target = new SequenceNode();
            target.Add(new ActionNode<SequenceTestNode>(()=>new SequenceTestNode(3)
                , n => n.Tick
                , n => n.Start
                , n => n.End
                ));

            Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            Assert.AreEqual(TICKRESULT.SUCCESS, target.Tick(0));
        }
Ejemplo n.º 2
0
        public void TestTick1()
        {
            SequenceNode target = new SequenceNode();
            target.Add(new ActionNode<NumberTestNode>(()=>new NumberTestNode(3)
                , n => n.Tick
                , n => n.Start
                , n => n.End
                ));

            /*target.Add(new ActionNode<NumberTestNode>(new NumberTestNode(2)
                , n => n.Tick
                , n => n.Start
                , n => n.End
                ));*/

            Assert.AreEqual( TICKRESULT.RUNNING , target.Tick(0));
            Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            Assert.AreEqual(TICKRESULT.SUCCESS, target.Tick(0));
            Assert.AreEqual(TICKRESULT.FAILURE, target.Tick(0));
        }
Ejemplo n.º 3
0
 /// <summary>Tick(Single) 的測試虛設常式</summary>
 internal TICKRESULT TickTest(SequenceNode target, float delta)
 {
     TICKRESULT result = target.Tick(delta);
     return result;
     // TODO: 將判斷提示加入 方法 SequenceNodeTest.TickTest(SequenceNode, Single)
 }