Esempio n. 1
0
        public static TWeather operator +(TWeather first, TWeather second)
        {
            TWeather weather = new TWeather();

            weather.WindSpeed = first.WindSpeed + second.WindSpeed;
            return(weather);
        }
Esempio n. 2
0
        public static TWeather operator /(TWeather first, int num)
        {
            TWeather weather = new TWeather();

            weather.WindSpeed = first.WindSpeed / num;
            return(weather);
        }
Esempio n. 3
0
        private TWeather Average(TMap map, Int32 x, Int32 y)
        {
            var      enumerator = map.GetNeighbours(x, y).GetEnumerator();
            TWeather result     = new TWeather();
            Int32    count      = 0;

            while (enumerator.MoveNext())
            {
                result += enumerator.Current.Weather;
                count++;
            }
            return(result / count);
        }