Пример #1
0
        public int RandomTemperature(string currentCondition)
        {
            int temp = 0;

            switch (currentCondition)
            {
            case ("Sunny"):
                temp = MyRandom.Next(75, 96);
                break;

            case ("Cloudy"):
                temp = MyRandom.Next(65, 75);
                break;

            case ("Rainy"):
                temp = MyRandom.Next(50, 65);
                break;

            case ("Stormy"):
                temp = MyRandom.Next(45, 61);
                break;

            case ("Snowing"):
                temp = MyRandom.Next(0, 33);
                break;

            case ("Windy"):
                temp = MyRandom.Next(40, 75);
                break;

            case ("Icy"):
                temp = MyRandom.Next(-10, 21);
                break;

            default:
                break;
            }
            return(temp);
        }
Пример #2
0
 public string GetRandomWeatherCondition()
 {
     return(weatherConditions[MyRandom.Next(0, weatherConditions.Count)]);
 }
Пример #3
0
 public void SetRealWeatherForcast()
 {
     predictedForecast = condition + " " + (temperature + MyRandom.Next(-10, 11));
 }
Пример #4
0
 public void SetBuyChance()
 {
     buyChance = MyRandom.Next(30, 75);
 }