예제 #1
0
        //add lemon
        public void BuyLemon(string question)
        {
            inventory.lemon.Clear();
            int lemon = PromptInputNumber(question, TestNumber);

            for (int i = 0; i < lemon; i++)
            {
                inventory.AddLemon();
            }
        }
예제 #2
0
        private void RefillLemons()
        {
            Console.WriteLine("Lemons: ");
            int lemonAmount = int.Parse(Console.ReadLine());

            if (lemonAmount != 0)
            {
                if ((lemonAmount * new Lemon().Price) > player1.Store.Money)
                {
                    Console.WriteLine("You don't have enough money to buy that many lemons. Please try again.");
                    UserInterface.DisplayCash(player1);
                    RefillLemons();
                }
                else
                {
                    inventory.AddLemon(lemonAmount);
                    dailyExpenses += (lemonAmount * new Lemon().Price);
                    money         -= (lemonAmount * new Lemon().Price);
                }
            }
        }