Exemplo n.º 1
0
        public void displayPlayerJailMenu(Player player)
        {
            //Only display this option if we are in jail
            if (player.getIsInJail() == false)
            {
                displayPlayerChoiceMenu(player);
                return;
            }
            int resp = 0;
            Console.WriteLine("\n{0}Please make a selection:\n", playerPrompt(player));

            Console.WriteLine("1. Finish turn");
            Console.WriteLine("2. View your details");

            Console.WriteLine("3. Pay $50 to get out of jail");
            Console.WriteLine("4. Try roll doubles to get out of jail");

            Console.Write("(1-4)>");
            //read response
            resp = inputInteger();
            //if response is invalid redisplay menu
            if (resp == 0)
                this.displayPlayerJailMenu(player);

            //perform choice according to number input
            switch (resp)
            {
                case 1:
                    break;
                case 2:
                    Console.WriteLine("==================================");
                    Console.WriteLine(player.FullDetailsToString());
                    Console.WriteLine("==================================");
                    this.displayPlayerJailMenu(player);
                    break;
                case 3:
                    this.payJailFee(player);
                    this.displayPlayerJailMenu(player);
                    break;
                case 4:
                    this.rollDoublesJail(player);
                    this.displayPlayerJailMenu(player);
                    break;
                default:
                    Console.WriteLine("That option is not avaliable. Please try again.");
                    this.displayPlayerJailMenu(player);
                    break;
            }
        }