public void SellLemonade(Player player, Pitcher pitcher, List <Day> daysPlayed, List <double> noOfCustomersBought) { while (pitcher.cupsToPitcher > 0 && player.inventory.lemons > recipe.lemon && player.inventory.sugar > recipe.sugar && player.inventory.ice > recipe.ice) { pitcher.cupsToPitcher--; if (pitcher.cupsToPitcher == 0) { pitcher.InventoryCheck(player, daysPlayed, noOfCustomersBought); pitcher = new Pitcher(player, recipe, daysPlayed, noOfCustomersBought); } } }
//can do public void RunGame(List <double> noOfCustomersBought) { Start(); GetDays(); while (i <= daysPlayed.Count - 1) { Console.WriteLine("day " + (i + 1)); player.inventory.DisplayCurrentInventory(); Console.WriteLine("Do you want to go to store?"); string shop = Console.ReadLine().ToLower(); switch (shop) { case "yes": { Console.Clear(); store.DisplayPrices(); store.Shopping(player); break; } case "no": { break; } } daysPlayed[i].weather.DisplayWeather(); player.inventory.DisplayCurrentInventory(); player.recipe.DisplayCurrentRecipe(); Console.WriteLine("Would you like to change the current recipe"); string recipechange = Console.ReadLine().ToLower(); switch (recipechange) { case "yes": player.ChooseLemons(); player.ChooseSugar(); player.ChooseIce(); player.PriceofLemonade(); break; case "no": break; } pitcher = new Pitcher(player, player.recipe, daysPlayed, noOfCustomersBought); if (pitcher.cupsToPitcher == 10) { DisplayCustomers(); daysPlayed[i].SellLemonade(player, pitcher); daysPlayed[i].EndDay(noOfCustomersBought); i++; Console.Clear(); } else if (pitcher.cupsToPitcher == 0) { pitcher.InventoryCheck(player, daysPlayed, noOfCustomersBought); pitcher = new Pitcher(player, player.recipe, daysPlayed, noOfCustomersBought); daysPlayed[i].EndDay(noOfCustomersBought); i++; Console.Clear(); } } }