public void PlayGame() { foreach (Day day in week) { GameMenu(); Console.WriteLine($"Current Day: {currentday}"); DayStart(day); currentday++; GameOver(); foreach (Customer customer in day.customers) { if (player1.pitcher1.CupsinPitcher == 0 && (player1.inventory1.lemons.Count > 0) && (player1.inventory1.icecubes.Count > 0) && (player1.inventory1.sugarcubes.Count > 0)) { UserInterface.DisplayRemainingInventory(player1.inventory1); player1.FillPitcher(); } if (player1.pitcher1.CupsinPitcher > 0) { bool didBuy = customer.DesicionToBuy(day.weather, player1.recipe); if (didBuy) { cupSold++; UserInterface.MakeSale(player1); } } } UserInterface.DisplayCurrentMoney(player1.wallet1); profitMoney = cupSold * .50; Console.WriteLine("Today you made ${0}", profitMoney); UserInterface.DisplayRemainingInventory(player1.inventory1); Console.ReadLine(); } }
public void FillPitcher() { recipe.SetRecipe(); Console.WriteLine("filling pitcher...."); Console.ReadLine(); inventory1.lemons.RemoveRange(0, recipe.amountOfLemons); inventory1.sugarcubes.RemoveRange(0, recipe.amountOfSugarCubes); inventory1.icecubes.RemoveRange(0, recipe.amountOfIceCubes); pitcher1.CupsinPitcher += 8; UserInterface.DisplayRemainingInventory(inventory1); }
public void InventoryAquisition(Player player1) { bool walkoutdoor = false; while (!walkoutdoor) { Console.WriteLine("Welcome to the Store " + " !!! Press 1 to buy lemons, 2 to buy sugar cubes, 3 to buy ice cubes, 4 to buy cups, and 5 to leave store"); switch (UserInterface.UserInput()) { case "1": Console.WriteLine("How many lemons would you like to purchase?"); Console.WriteLine("Lemons cost {0} per lemon", pricePerLemon); double quantity = UserInterface.ChangeToDouble(); double cost = quantity * pricePerLemon; UserInterface.DisplayRemainingInventory(player1.inventory1); if (player1.wallet1.Money >= cost) { Console.WriteLine("you have purchased {0}", quantity); player1.inventory1.AddLemons(quantity); Console.WriteLine("thanks for buying {0} lemons for ${1}", quantity, cost); player1.wallet1.Money -= cost; UserInterface.DisplayCurrentMoney(player1.wallet1); } else { Console.WriteLine("you need more money for this come back later"); } break; case "2": Console.WriteLine("How many sugar cubes would you like to purchase?"); Console.WriteLine("Sugar cubes cost {0} per cube", pricePerSugar); quantity = UserInterface.ChangeToDouble(); cost = quantity * pricePerSugar; if (player1.wallet1.Money >= cost) { Console.WriteLine("you have purchased" + quantity); player1.inventory1.AddSugarCubes(quantity); Console.WriteLine("thanks for buying {0} sugar cubes for ${1}", quantity, cost); player1.wallet1.Money -= cost; UserInterface.DisplayCurrentMoney(player1.wallet1); } else { Console.WriteLine("you need more money for this come back later"); } break; case "3": Console.WriteLine("How many Ice Cubes would you like to purchase?"); Console.WriteLine("Price per Ice Cube is = {0}", pricePerIceCube); quantity = UserInterface.ChangeToDouble(); cost = quantity * pricePerIceCube; if (player1.wallet1.Money >= cost) { Console.WriteLine("you have purchased" + quantity); player1.inventory1.AddIceCubes(quantity); Console.WriteLine("thanks for buying {0} ice cubes for ${1}", quantity, cost); player1.wallet1.Money -= cost; UserInterface.DisplayCurrentMoney(player1.wallet1); } else { Console.WriteLine("you need more money for this come back later"); } break; case "4": Console.WriteLine("How many cups would you like to purchase?"); Console.WriteLine("Price per cup is = {0}", pricePerCup); quantity = UserInterface.ChangeToDouble(); cost = quantity * pricePerCup; if (player1.wallet1.Money >= cost) { Console.WriteLine("you have purchased" + quantity); player1.inventory1.AddCups(quantity); Console.WriteLine("thanks for buying {0} cups for ${1}", quantity, cost); player1.wallet1.Money -= cost; UserInterface.DisplayCurrentMoney(player1.wallet1); } else { Console.WriteLine("you need more money for this come back later"); } break; case "5": walkoutdoor = true; Console.WriteLine("Thanks for visiting and good luck!!!"); break; default: Console.WriteLine("Invalid Input Please Try Again!"); break; } } }