Пример #1
0
        public void ReadTroopsTest()
        {
            string      path   = TestContext.CurrentContext.TestDirectory;
            TroopReader reader = new TroopReader(path);
            Dictionary <string, TroopType> troopTypes = reader.Read();

            Assert.AreEqual(troopTypes.Count, 4);
        }
Пример #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();
        }