public static TWeather operator +(TWeather first, TWeather second) { TWeather weather = new TWeather(); weather.WindSpeed = first.WindSpeed + second.WindSpeed; return(weather); }
public static TWeather operator /(TWeather first, int num) { TWeather weather = new TWeather(); weather.WindSpeed = first.WindSpeed / num; return(weather); }
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); }