static void Main(string[] args)
        {
            IMessageHandler consoleMessageHandler = new ConsoleOutput();
            ConsolePlayer   player = new ConsolePlayer();

            while (true)
            {
                DisplayGameTitle();

                CharacterType type           = player.ChooseHeroCategory();
                string        name           = player.ChooseHeroName();
                int           alliesNumber   = player.ChooseCharactersNumber(0, "allies");
                int           monstersNumber = player.ChooseCharactersNumber(1, "monsters");

                Battlefield battlefield = new Battlefield(consoleMessageHandler);
                battlefield.RunBattle(type, name, player, alliesNumber, monstersNumber);

                Console.WriteLine("Do you want to play again? [Y/N]");
                if (Console.ReadKey(true).Key != ConsoleKey.Y)
                {
                    return;
                }

                Console.Clear();
            }
        }
        static void Main(string[] args)
        {
            IMessageHandler consoleMessageHandler = new ConsoleOutput();
            ConsolePlayer   player    = new ConsolePlayer();
            ConsolePlayer   numAllies = new ConsolePlayer();
            ConsolePlayer   numEnemys = new ConsolePlayer();

            while (true)
            {
                DisplayGameTitle();

                CharacterType type = player.ChooseHeroCategory();
                string        name = player.ChooseHeroName();

                string num_allies = numAllies.ChooseNumAllies();
                string num_enemys = numEnemys.ChooseNumEnemys();

                Battlefield battlefield = new Battlefield(consoleMessageHandler);
                battlefield.RunBattle(type, name, player, num_enemys, num_allies);

                Console.WriteLine("Do you want to play again? [Y/N]");
                if (Console.ReadKey(true).Key != ConsoleKey.Y)
                {
                    return;
                }

                Console.Clear();
            }
        }
        static void Main(string[] args)
        {
            IMessageHandler consoleMessageHandler = new ConsoleOutput();
            ConsolePlayer   player = new ConsolePlayer();

            while (true)
            {
                DisplayGameTitle();

                CharacterType type = player.ChooseHeroCategory();
                string        name = player.ChooseHeroName();


                Console.WriteLine("How many allies do you want?");
                int numberOfHeroes = int.Parse(Console.ReadLine());


                Console.WriteLine("How many opponents do you want?");
                int numberOfMonsters = int.Parse(Console.ReadLine());

                Battlefield battlefield = new Battlefield(consoleMessageHandler);
                battlefield.RunBattle(type, name, player, numberOfHeroes, numberOfMonsters);

                Console.WriteLine("Do you want to play again? [Y/N]");
                if (Console.ReadKey(true).Key != ConsoleKey.Y)
                {
                    return;
                }

                Console.Clear();
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            IMessageHandler consoleMessageHandler = new ConsoleOutput();
            ConsolePlayer   player = new ConsolePlayer();

            while (true)
            {
                DisplayGameTitle();

                CharacterType type = player.ChooseHeroCategory();
                string        name = player.ChooseHeroName();

                //TODO
                //Forse il programma non genera il numero corretto di personaggi
                //inserire un metodo per la visualizzazione del party all'inizio della partita dopo la generazione dei personaggi

                int numberOfHeroPartyMembers    = player.ChooseHeroPartyNumber();
                int numberOfMonsterPartyMembers = player.ChooseMonsterPartyNumber();

                Battlefield battlefield = new Battlefield(consoleMessageHandler, numberOfHeroPartyMembers, numberOfMonsterPartyMembers);
                battlefield.RunBattle(type, name, player);

                Console.WriteLine("Do you want to play again? [Y/N]");
                if (Console.ReadKey(true).Key != ConsoleKey.Y)
                {
                    return;
                }

                Console.Clear();
            }
        }