Пример #1
0
        public void BattleTest()
        {
            BattleSimulator sim = new BattleSimulator(monkeyArmy, wizardArmy);

            sim.Battle();
            Assert.AreEqual(wizardArmy.Name, sim.Result.Winner.Name);
            Console.WriteLine(sim.Result);
        }
Пример #2
0
        static void Main(string[] args)
        {
            TroopReader troopReader = new TroopReader();

            troopTypes = troopReader.Read();

            TroopFactory troopFactory = new TroopFactory(troopTypes);
            ArmyReader   armyReader   = new ArmyReader(troopFactory);

            armies = armyReader.Read();

            PrintArmy("Good Army");
            Console.WriteLine();
            PrintArmy("Bad Army");

            Army            a   = armies["Good Army"];
            Army            b   = armies["Bad Army"];
            BattleSimulator sim = new BattleSimulator(a, b);

            sim.Battle();
            Console.WriteLine(sim.Result);
            Console.ReadLine();
        }