diff --git a/cli.cs b/cli.cs index 50e5452..eea3568 100644 --- a/cli.cs +++ b/cli.cs @@ -1,15 +1,37 @@ namespace Weather { + //TODO: Implement C/F icon (add field in Weather class) public class Cli { + + public static void printCurrent(Geolocation.Place place, Weather forecast) + { + string current = new string(""); + + current += $"Current weather in: {place.name}, {place.country}\n"; + current += $"{forecast.weatherCurrent.main}, {forecast.weatherCurrent.temp} degrees"; + + Console.WriteLine(current); + } + + //TODO: finish this monseter public static void printDaily(Geolocation.Place place, Weather forecast) { - string output = new string(""); + string current = new string(""); - output += $"Current weather in: {place.name}, {place.country}\n"; - output += $"Temperature: {forecast.weatherCurrent.temp}"; + current += $"Current weather in: {place.name}, {place.country}\n"; + current += $"{forecast.weatherCurrent.main}, {forecast.weatherCurrent.temp} degrees"; - Console.WriteLine(output); + string hourlyForecast = new string(""); + + foreach (var hour in forecast.weatherHourly.list) + { + hourlyForecast += $"{hour.datetime.ToString("HH:mm tt")}: {hour.temp} °C\n"; + + } + + Console.WriteLine(current); + Console.WriteLine(hourlyForecast); } // TODO: implement weekly forecast