예제 #1
0
        public void MainMenu()
        {
            Console.Clear();
            Console.WriteLine("Welcome " + player.Name);
            Console.WriteLine("It is currently day: " + gameDay);
            Console.WriteLine("GAME MENU\n=========\nPlease choose an option below:\n'Store', 'Inventory', 'Recipe', 'Change Recipe', 'Money', 'Sale Price', 'Weather Forecast', 'Start Day', 'Exit'");
            string menuChoice = Console.ReadLine().ToLower();


            switch (menuChoice)
            {
            case "store":
                store.ShopMenu(player);
                Console.WriteLine();
                Console.ReadLine();
                MainMenu();
                break;

            case "inventory":
                player.inventory.ShowItems(player);
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "recipe":
                player.recipe.ShowRecipe(player.recipe, player);
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "change recipe":
                player.recipe.ChangeRecipe(player.recipe, player);
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "sale price":
                Console.WriteLine($"Your sale price is currently {player.salePrice} per cup of lemonade. Please type 'change sale price' to enter a new sale price");
                Console.ReadKey();
                MainMenu();
                break;

            case "change sale price":
                player.ChangeSalePrice();
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "money":
                player.inventory.ShowMoney(player);
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "cheat money":
                Console.WriteLine($"Money Cheat: {player.inventory.money} is the current balance. Enter the amount you would like to add to your balance.");
                double moneyToAdd = Convert.ToDouble(Console.ReadLine());
                player.inventory.AddMoney(moneyToAdd, player);
                Console.WriteLine($"Your balance is now {player.inventory.money}");
                Console.ReadKey();
                MainMenu();
                break;

            case "cheat items":
                player.inventory.CheatItems(player);
                MainMenu();
                break;

            case "weather forecast":
                Day.weather.DisplayWeather();
                Console.WriteLine();
                Console.ReadKey();
                MainMenu();
                break;

            case "start day":
                DayPhase(player.inventory);
                break;

            case "exit":
                EndGame();
                break;

            default:
                Console.WriteLine("Try again!");
                Console.ReadKey();
                MainMenu();
                break;
            }
        }