예제 #1
0
파일: Day.cs 프로젝트: tvang83/lemonade
 //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
 }
예제 #2
0
 //Constructor
 public Day()
 {
     weather = new Weather();
 }
예제 #3
0
        public void DisplayWeather(Weather weather)

        {
            Console.WriteLine($"Day {days.Count}: \nToday's weather is {weather.condition}/{weather.temperature} F\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);
     }
 }