Beispiel #1
0
        /// <summary>
        ///   Process user selection
        /// </summary>
        private void ProcessSelection()
        {
            switch (Selection)
            {
            case -1:
                Console.Clear();
                // go back to main menu
                Header();
                break;

            case 1:
                Console.Clear();
                RestaurantScreen.ToJSON();
                break;

            case 2:
                Console.Clear();
                Console.Write("Please enter your name: ");
                var name = Console.ReadLine();
                RatingSystemScreen.MainMenu(name);
                break;

            case 3:
                RestaurantScreen.MainMenu();
                break;

            case 4:
                CardGameScreen.Welcome();
                break;

            case 5:
                Console.Clear();
                Environment.Exit(Environment.ExitCode);
                break;

            default:
                Console.WriteLine("Invalid selection, press any key...");
                Console.ReadLine();
                Console.Clear();
                // go back to main menu
                Header();
                break;
                ;
            }
        }
Beispiel #2
0
 public Welcome()
 {
     RestaurantScreen = new RestaurantScreen(() =>
     {
         Selection = -1;
         ProcessSelection();
     });
     Selection          = default;
     RatingSystemScreen = new RatingSystemScreen(() =>
     {
         Selection = -1;
         ProcessSelection();
     });
     CardGameScreen = new CardGameScreen(() =>
     {
         Selection = -1;
         ProcessSelection();
     });
 }