Ejemplo n.º 1
0
 //constructors
 public Day()
 {
     weather   = new Weather();         //obtains the temperature and conditions from Weather class
     customers = new List <Customer>(); //calls customer class for customer name from list name
 }
Ejemplo n.º 2
0
 //Constructor
 public Day()
 {
     weather = new Weather();
 }
Ejemplo n.º 3
0
        public void DisplayWeather(Weather weather)

        {
            Console.WriteLine($"Day {days.Count}: \nToday's weather is {weather.condition}/{weather.temperature} F\n");
        }
Ejemplo n.º 4
0
 public void HowMuchLemonadeToBuy(Player player, Weather weather, Recipe recipe, Pitcher pitcher)
 {
     //random = new Random();
     if (weather.weatherCondition == weather.ListOfWeatherConditions[1])
     {
         if (weather.temperature >= 70)
         {
             if (recipe.pricePerCup <= 0.10)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(3);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[2])
     {
         if (weather.temperature >= 60)
         {
             if (recipe.pricePerCup <= 0.20)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(5);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[3])
     {
         if (weather.temperature >= 65)
         {
             if (recipe.pricePerCup <= 0.15)
             {
                 if (recipe.amountOfLemons >= 3)
                 {
                     amountOfLemonadeBuying = random.Next(4);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (weather.weatherCondition == weather.ListOfWeatherConditions[4] && weather.temperature >= 70 && recipe.pricePerCup <= 0.15 && recipe.amountOfLemons >= 5 && recipe.amountOfSugarCubes >= 5)
     {
         if (weather.temperature >= 80)
         {
             if (recipe.pricePerCup <= 0.25)
             {
                 if (recipe.amountOfLemons >= 5)
                 {
                     amountOfLemonadeBuying = random.Next(5);
                     BuyLemonade(player, recipe, pitcher);
                 }
             }
         }
     }
     else if (recipe.pricePerCup <= 0.10)
     {
         amountOfLemonadeBuying = random.Next(3);
         BuyLemonade(player, recipe, pitcher);
     }
     else
     {
         amountOfLemonadeBuying = random.Next(2);
         BuyLemonade(player, recipe, pitcher);
     }
 }