示例#1
0
        public void IWantToPromptActorForActions()
        {
            var member1 = new MokupMember(0, 1);
            var member2 = new MokupMember(1, 3);
            var member3 = new MokupMember(2, 2);
            var member4 = new MokupMember(3, 4);



            TurnManager mgr = new TurnManager();

            mgr.Actors.Add(member3);
            mgr.Actors.Add(member4);
            mgr.Actors.Add(member1);
            mgr.Actors.Add(member2);
            mgr.Start();
            mgr.Update();

            //assert that current actor is the highest agility
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);

            //finish turn of this actor
            member4.PromptFinished();
            mgr.Update();
            //assert that current actor is the one with 3 agility
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();
        }
示例#2
0
        public void IWantToPromptActorForActions()
        {
            var member1 = new MokupMember(0,1);
            var member2 = new MokupMember(1,3);
            var member3 = new MokupMember(2,2);
            var member4 = new MokupMember(3,4);

            TurnManager mgr = new TurnManager();
            mgr.Actors.Add(member3);
            mgr.Actors.Add(member4);
            mgr.Actors.Add(member1);
            mgr.Actors.Add(member2);
            mgr.Start();
            mgr.Update();

            //assert that current actor is the highest agility
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);

            //finish turn of this actor
            member4.PromptFinished();
            mgr.Update();
            //assert that current actor is the one with 3 agility
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();
        }
示例#3
0
        public void PromptForActionsUntilItLoopsBackToFirstMember()
        {
            var member1 = new MokupMember(0, 1);
            var member2 = new MokupMember(1, 3);
            var member3 = new MokupMember(2, 2);
            var member4 = new MokupMember(3, 4);

            TurnManager mgr = new TurnManager();
            mgr.Actors.Add(member3);
            mgr.Actors.Add(member4);
            mgr.Actors.Add(member1);
            mgr.Actors.Add(member2);
            mgr.Start();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);
            member4.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 2);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 0);
            member2.PromptFinished();

            //should loop back to id 3 here
            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 2);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 0);
            member2.PromptFinished();
        }
示例#4
0
        public void PromptForActionsUntilItLoopsBackToFirstMemberWithChangedSpeed()
        {
            var member1 = new MokupMember(0, 1);
            var member2 = new MokupMember(1, 3);
            var member3 = new MokupMember(2, 2);
            var member4 = new MokupMember(3, 4);



            TurnManager mgr = new TurnManager();

            mgr.Actors.Add(member3);
            mgr.Actors.Add(member4);
            mgr.Actors.Add(member1);
            mgr.Actors.Add(member2);
            mgr.Start();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);
            member4.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 2);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 0);
            member2.PromptFinished();

            member2.GetStatNamed("Agility").BaseValue += 10;

            //should loop back to id 1 here
            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 1);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 3);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 2);
            member2.PromptFinished();

            mgr.Update();
            Assert.IsTrue(mgr.CurrentActor.GetId() == 0);
            member2.PromptFinished();
        }