public LocationForecast getLocationForecast(string cityName) { JSONForecast jsonObject = JSONtoJSONObject(cityName); LocationForecast lf = new LocationForecast(); lf.Name = StringHandler.toUTFString(jsonObject.city.name); foreach (var lo in jsonObject.list) { lf.ForecastDict.Add(UnixToDatetime.UnixTimeStampToDateTime(lo.dt), getSingle(lf.Name, lo)); } return(lf); }
public LocationDailyWeather getSingle(string name, HourlyWeather lo) { return(new LocationDailyWeather(name, UnixToDatetime.UnixTimeStampToDateTime(lo.dt), lo.main.temp, lo.main.temp_min, lo.main.temp_max, lo.main.pressure, lo.main.sea_level, lo.main.humidity, lo.clouds.all, lo.wind.speed, lo.wind.deg, lo.weather[0].icon)); }