Beispiel #1
0
        public void Battle_Side()
        {
            Unit angel    = new UnitAngel();
            Unit skeleton = new UnitSkeleton();

            UnitsStack stack1 = new UnitsStack(angel, 10);
            UnitsStack stack2 = new UnitsStack(skeleton, 42);
            UnitsStack stack3 = new UnitsStack(angel, 2);

            List <UnitsStack> stacks1 = new List <UnitsStack> {
                stack1, stack2
            };
            List <UnitsStack> stacks2 = new List <UnitsStack> {
                stack3
            };

            Army army1 = new Army(stacks1);
            Army army2 = new Army(stacks2);

            Battle battle = new Battle(army1, army2);

            BattleArmy battleArmy1 = battle.GetAttacker();
            BattleArmy battleArmy2 = battle.GetTarget();

            Assert.IsTrue(battleArmy1.IsAttacker());
            Assert.IsFalse(battleArmy1.IsTarget());
            Assert.IsFalse(battleArmy2.IsAttacker());
            Assert.IsTrue(battleArmy2.IsTarget());
        }
Beispiel #2
0
 public string GetMessage()
 {
     return((_source.IsAttacker() ? "Attacker" : "Target") + " surrendered");
 }