Exemplo n.º 1
0
        /// <summary>
        /// Shows main game menu
        /// </summary>
        public void ShowMenu()
        {
            while (true)
            {
                //Show menu interface
                Console.WriteLine("********** - - - Prší - - - **********");
                Console.WriteLine("1. New game");
                Console.WriteLine("2. Tutorial");
                Console.WriteLine("3. Options");
                Console.WriteLine("4. Quit");

                switch (Console.ReadKey().KeyChar)
                {
                case '1':
                    //Start new game
                    Console.WriteLine("\nStarting new game");
                    gamePlay.Play();
                    break;

                case '2':
                    //Load game from xml file
                    Console.WriteLine("\nTutorial");
                    Tutorial();
                    break;

                case '3':
                    //Set if aces are overrulable
                    Console.WriteLine("\nOptions menu:");
                    GameOption.SetOption();
                    break;

                case '4':
                    //Make sure user really wants to exit
                    Console.WriteLine("\nPress 'y' to quit");
                    if (Console.ReadKey().KeyChar == 'y')
                    {
                        //user pressed y, exitting app
                        Environment.Exit(0);
                    }
                    else
                    {
                        //user pressed something else, do not quit app
                        Console.WriteLine();
                    }
                    break;

                default:
                    //user pressed differnt key
                    Console.WriteLine("\nThis is not a valid option");
                    break;
                }
            }
        }