public void CreateCustomers(Player playerOne, Inventory playerInventory, Customer customer, int spawnNumber) { if (playerInventory.CanFillPitcher()) { playerInventory.FillAPitcher(); } else { Console.WriteLine("You have no Lemonade to sell!"); } Random rng = new Random(); for (int i = 0; i < spawnNumber; i++) { switch (rng.Next(1, 5)) { case 1: customer = new OldWoman(); SetTolerance(customer, playerInventory); SalesLogic(playerOne, playerInventory, customer); customer = null; break; case 2: customer = new YoungMan(); SetTolerance(customer, playerInventory); SalesLogic(playerOne, playerInventory, customer); customer = null; break; case 3: customer = new Child(); SetTolerance(customer, playerInventory); SalesLogic(playerOne, playerInventory, customer); customer = null; break; case 4: customer = new Alien(); SetTolerance(customer, playerInventory); SalesLogic(playerOne, playerInventory, customer); customer = null; break; } System.Threading.Thread.Sleep(10); } }
public void CreateCustomer() { Customer customer; int customerTypeRoll = rng.Next(0, 7); switch (customerTypeRoll) { case 1: customer = new YoungMan(); break; case 2: customer = new YoungWoman(); break; case 3: customer = new LittleBoy(); break; case 4: customer = new LittleGirl(); break; case 5: customer = new OldWoman(); break; case 6: customer = new OldMan(); break; default: customer = new OldMan(); break; } customers.Add(customer); }