Ejemplo n.º 1
0
        public void Play()
        {
            for (int readyPlayers = 0; readyPlayers < 2; readyPlayers++)
            {
                visualization.ShowProgramMessage("Player " + (activePlayer.Id + 1) + " Please choose your Deck and Captain");
                visualization.printSeparator();
                visualization.ShowDecks(decks);
                int deckNumberAnswer = visualization.GetUserInput(decks.Count, false);
                visualization.printSeparator();
                activePlayer.Deck = decks[deckNumberAnswer];
                activePlayer.FirstHand();
                visualization.ShowCaptains(captains);
                visualization.printSeparator();
                int captainNumberAnswer = visualization.GetUserInput(Captains.Count, false);
                visualization.printSeparator();
                activePlayer.ChooseCaptainCard(Captains[captainNumberAnswer]);
                visualization.ShowHand(activePlayer.Hand);
                visualization.printSeparator();
                visualization.ShowListOptions(changeCardOptionList, readyOrNot);
                visualization.printSeparator();
                int answerReadyOrNot = visualization.GetUserInput(changeCardOptionList.Count, false);

                if (answerReadyOrNot == 0)
                {
                    visualization.printSeparator();
                    visualization.ShowProgramMessage("Player " + (activePlayer.Id + 1) + " change your cards");
                    visualization.printSeparator();

                    for (int i = 0; i < 3; i++)
                    {
                        visualization.ShowHand(activePlayer.Hand);
                        visualization.printSeparator();
                        visualization.ShowProgramMessage("Input the number of the cards you want to change (Max 3). Input -1 to stop " + i);
                        int loopAnswer = visualization.GetUserInput(activePlayer.Hand.Cards.Count, true);
                        visualization.printSeparator();
                        if (loopAnswer == -1)
                        {
                            i = 4;
                        }
                        else
                        {
                            activePlayer.ChangeCard(loopAnswer);
                        }
                    }

                    visualization.printSeparator();
                    visualization.ShowProgramMessage("Done those all your changes. Now youre ready to fight!!!");
                }
                visualization.printSeparator();
                visualization.ShowProgramMessage("OK Thats all you need Player " + (activePlayer.Id + 1) + " now ... PREPARE TO FIGHT TILL YOUR LAST BREATH");
                visualization.printSeparator();
                visualization.ShowProgramMessage("Press any key to clear console and change player");
                Console.ReadKey();
                visualization.ClearConsole();
                if (activePlayer.Id == players[0].Id)
                {
                    activePlayer = players[1];
                }
                else
                {
                    activePlayer = players[0];
                }
            }
        }