예제 #1
0
        public BattleUnitStack GetBattleUnitStack(BattleArmy army)
        {
            try {
                Console.WriteLine("Choose target Unit");
                for (int i = 0; i < army.PBattleArmy.Count(); i++)
                {
                    Console.WriteLine(i + " " + army.PBattleArmy[i].PType.GetStringType() + " " + army.PBattleArmy[i].PCount);
                }
                Console.WriteLine();

                int selectedBattleUnitStack = Convert.ToInt32(Console.ReadLine());
                return(army.PBattleArmy[selectedBattleUnitStack]);
            }
            catch {
                Console.WriteLine("WRONG OPTION when choosing BattleStack");
                throw;
            }
        }
예제 #2
0
        public Battle(BattleArmy army0, BattleArmy army1)
        {
            _army[0] = army0;
            _army[1] = army1;

            _army[0].PTeam = 0;
            _army[1].PTeam = 1;

            _turnOrder = new TurnOrder(_army);

            string option = "";

            while ((_army[0].Alive() && _army[1].Alive()) && option != "Surrender")
            {
                if (_turnOrder.IsEmpty())
                {
                    _turnOrder = new TurnOrder(_army);
                }
                option = Round(_army);
            }
        }