public void CheckForCustomer(Player player, Pitcher pitcher, Inventory inventory, Weather weather) { int chance = dayRandom.Next(0, 100); if (chance <= 80 && !isRaining) { Customer customer = new Customer(); customer.Randomize(); if (customer.WillPurchase(player, weather, pitcher)) { BuyCup(player, pitcher, inventory); if (customer.CheckingCustomerBuyingStatus(pitcher)) { BuyCup(player, pitcher, inventory); } else { Console.WriteLine("No customer walk by..."); } } } else { Console.WriteLine("*The rain is pouring hard so no customer stop to buy any lemonade!*\n"); } }
public Customer MakeCustomer() { Customer customer = new Customer(); customer.Randomize(); return(customer); }
public void CheckForCustomer(Player player, Pitcher pitcher, Inventory inventory, Weather weather) { Thread.Sleep(20); int chance = dayRandom.Next(0, 100); if (chance <= 90 && !isRaining) { Customer customer = new Customer(); customer.Randomize(); Console.WriteLine("\n{0} walks by your stand.", customer.GetName()); if (customer.WillBuy(player, weather, pitcher)) { BuyCup(player, pitcher, inventory); if (customer.DetermineIfCustomerWillBuyAgain(pitcher)) { Console.WriteLine("{0} says, 'I'll take another cup please!'", customer.GetName()); BuyCup(player, pitcher, inventory); } } } else { Console.WriteLine("\nThere are no customers right now.\n"); } }