Beispiel #1
0
        //member methods
        public int SellLemons(Player player, Inventory inventory)
        {
            UserInterface.PurchaseLemonsPrompt();
            int response;

            while (!int.TryParse(Console.ReadLine(), out response) || player.CashOnHand < (lemonPrice * response))
            {
                UserInterface.InvalidLemonResponse();
            }
            player.CashOnHand    -= (lemonPrice * response);
            inventory.LemonCount += (1 * response);
            int moneySpentOnLemons = lemonPrice * response;

            return(moneySpentOnLemons);
        }