コード例 #1
0
ファイル: CoroutineTest.cs プロジェクト: tuita520/Regulus
        public void TestDirectCount3ToFailure()
        {
            var     obj       = new CoroutineTestObject();
            ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.DirectCount3ToFailure());
            var     res1      = coroutine.Tick(0);
            var     res2      = coroutine.Tick(0);
            var     res3      = coroutine.Tick(0);
            var     res4      = coroutine.Tick(0);
            var     res5      = coroutine.Tick(0);

            Assert.AreEqual(TICKRESULT.RUNNING, res1);
            Assert.AreEqual(TICKRESULT.RUNNING, res2);
            Assert.AreEqual(TICKRESULT.RUNNING, res3);
            Assert.AreEqual(TICKRESULT.FAILURE, res4);
            Assert.AreEqual(TICKRESULT.RUNNING, res5);
        }
コード例 #2
0
ファイル: CoroutineTest.cs プロジェクト: tuita520/Regulus
        public void TestDirectNull()
        {
            var     obj       = new CoroutineTestObject();
            ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.DirectNull());
            var     res1      = coroutine.Tick(0);

            Assert.AreEqual(TICKRESULT.SUCCESS, res1);
        }
コード例 #3
0
ファイル: CoroutineTest.cs プロジェクト: tuita520/Regulus
        public void UntilCount3ToToSuccess()
        {
            var     obj       = new CoroutineTestObject();
            ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.UntilCount3ToSuccess());
            var     res1      = coroutine.Tick(0);
            var     res2      = coroutine.Tick(0);
            var     res3      = coroutine.Tick(0);
            var     res4      = coroutine.Tick(0);
            var     res5      = coroutine.Tick(0);
            var     res6      = coroutine.Tick(0);

            Assert.AreEqual(TICKRESULT.RUNNING, res1);
            Assert.AreEqual(TICKRESULT.RUNNING, res2);
            Assert.AreEqual(TICKRESULT.RUNNING, res3);
            Assert.AreEqual(TICKRESULT.RUNNING, res4);
            Assert.AreEqual(TICKRESULT.RUNNING, res5);
            Assert.AreEqual(TICKRESULT.SUCCESS, res6);
        }