private List <Customer> GenerateCustomerList(Weather weather, Recipe recipe) { List <Customer> buyingCustomers = new List <Customer>(); int numberOfCustomers = Randomness.RandomInt(100, 200); for (int i = 0; i < numberOfCustomers; i++) { Customer customer = new Customer(weather, recipe); if (customer.isBuying) { buyingCustomers.Add(customer); } } return(buyingCustomers); }
private void SetCondition() { conditions = new List <string>() { "immaculately beautiful", "sunny", "partly sunny", "partly cloudy", "cloudy", "rainy", "thunderstormy", "nuclear wintery" }; int randomIndex = Randomness.RandomInt(0, conditions.Count - 1); forecastCondition = conditions[randomIndex]; int randomModifier = Randomness.RandomInt(-1, 1); if (randomIndex + randomModifier < 0 || randomIndex + randomModifier >= conditions.Count) { actualCondition = conditions[randomIndex]; } else { actualCondition = conditions[randomIndex + randomModifier]; } }
public Customer(Weather weather, Recipe recipe) { thirstLevel = Randomness.RandomInt(0, 30); priceLimit = Randomness.RandomCustomerMaximumPayThreshold(); IsCustomerBuying(weather, recipe); }
private void SetTemperature() { forecastTemperature = Randomness.RandomTemperature(); actualTemperature = forecastTemperature + Randomness.RandomInt(-5, 5); }