Exemplo n.º 1
0
        public void SellToPlayer(Player player, UI ui, List <string> options, Game game)
        {
            bool exitIsSelected = false;

            while (!exitIsSelected)
            {
                ui.DisplayStoreMenu(this, player);
                userInput = ui.GetUserInput(options, game);
                switch (userInput)
                {
                case "1":
                    SellLemons(player, ui);
                    break;

                case "2":
                    SellSugar(player, ui);
                    break;

                case "3":
                    SellIce(player, ui);
                    break;

                case "4":
                    SellCups(player, ui);
                    break;

                case "5":
                    exitIsSelected = true;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public void GetStartLoadOrExit(Game game)
        {
            ui.DisplayInitialMenu();
            string userInput = ui.GetUserInput(InitialMenuOptions, game);

            switch (userInput)
            {
            case "start":
                Console.Clear();
                Console.WriteLine("You've started a game!");
                Console.WriteLine(Environment.NewLine);
                RunGame(game);
                break;

            case "exit":
                Console.Clear();
                Console.WriteLine("You've exited the game!");
                break;
            }
        }
Exemplo n.º 3
0
        public void SetRecipe(UI ui, List <string> options, Game game)
        {
            string userInput;
            int    userQuantityInput = 0;
            bool   exitIsSelected    = false;

            while (!exitIsSelected)
            {
                Console.Clear();
                ui.DisplayRecipeMenu(this);
                userInput = ui.GetUserInput(options, game);
                switch (userInput)
                {
                case "1":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetLemonsAmount(userQuantityInput);
                    break;

                case "2":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetSugarsAmount(userQuantityInput);
                    break;

                case "3":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetIceAmount(userQuantityInput);
                    break;

                case "4":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetLemonadePrice(userQuantityInput);
                    break;

                case "5":
                    exitIsSelected = true;
                    break;
                }
            }
        }