Example #1
0
        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);
        }
Example #2
0
        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];
            }
        }
Example #3
0
 public Customer(Weather weather, Recipe recipe)
 {
     thirstLevel = Randomness.RandomInt(0, 30);
     priceLimit  = Randomness.RandomCustomerMaximumPayThreshold();
     IsCustomerBuying(weather, recipe);
 }
Example #4
0
 private void SetTemperature()
 {
     forecastTemperature = Randomness.RandomTemperature();
     actualTemperature   = forecastTemperature + Randomness.RandomInt(-5, 5);
 }