示例#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
                                                         ));


            NUnit.Framework.Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            NUnit.Framework.Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            NUnit.Framework.Assert.AreEqual(TICKRESULT.SUCCESS, target.Tick(0));
        }
示例#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
             *  ));*/

            NUnit.Framework.Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            NUnit.Framework.Assert.AreEqual(TICKRESULT.RUNNING, target.Tick(0));
            NUnit.Framework.Assert.AreEqual(TICKRESULT.SUCCESS, target.Tick(0));
            NUnit.Framework.Assert.AreEqual(TICKRESULT.FAILURE, target.Tick(0));
        }