示例#1
0
        public int SellIce(Player player, Inventory inventory)
        {
            UserInterface.PurchaseIcePrompt();
            int response;

            while (!int.TryParse(Console.ReadLine(), out response) || player.CashOnHand < (icePrice * response))
            {
                UserInterface.InvalidIceResponse();
            }
            player.CashOnHand  -= (icePrice * response);
            inventory.IceCount += (1 * response);
            int moneySpentOnIce = icePrice * response;

            return(moneySpentOnIce);
        }