예제 #1
0
        public void Attack(Army selectedArmy)
        {
            int secondID;

            do
            {
                Console.Write("Enter a id of enemy army:");
                secondID = Convert.ToInt32(Console.ReadLine());
            } while (secondID > Armies.Count - 1 && secondID != Armies.IndexOf(selectedArmy));

            BattleField Battle = new BattleField(selectedArmy, Armies[secondID]);

            Battle.StartBattle();
        }
예제 #2
0
        public void StartFight()
        {
            int firstID;

            do
            {
                Console.Write("Enter a id of first army:");
                firstID = Convert.ToInt32(Console.ReadLine());
            } while (firstID > Armies.Count - 1);

            int secondID;

            do
            {
                Console.Write("Enter a id of first army:");
                secondID = Convert.ToInt32(Console.ReadLine());
            } while (secondID > Armies.Count - 1 && secondID != firstID);

            BattleField Battle = new BattleField(Armies[firstID], Armies[secondID]);

            Battle.StartBattle();
        }