예제 #1
0
        public static void Main(string[] args)
        {
            List <WeatherCardClass> lWeatherCardList = new List <WeatherCardClass>();
            Settings  lUserSettings  = new Settings();
            WebScrape lWebscrapeData = new WebScrape(ref lUserSettings);

            MakeWeatherCards(ref lUserSettings, ref lWeatherCardList, ref lWebscrapeData); //need to make something to store the data
            BestRunTimes(ref lUserSettings, ref lWeatherCardList);
            PrintBestTimes(ref lUserSettings, ref lWeatherCardList);
        }
예제 #2
0
        /*
         * Function makes the objects to store weather information for each point in time using information from the
         * user settings and thepreviously web scraped data.
         *
         * For Loop: Iterates through every row of data captured from weather.com's hour-by-hour forecast. Adds weather
         * card to the list for later retrieval.
         *
         * Return: Returns the list of weather cards created.
         */
        private static List <WeatherCardClass> MakeWeatherCards(ref Settings lUserSettings, ref List <WeatherCardClass> lWeatherCardList,
                                                                ref WebScrape lWebscrapeData)

        {
            for (int lTimeDataIndex = 0; lTimeDataIndex < lWebscrapeData.TimeData.Count(); ++lTimeDataIndex)
            {
                WeatherCardClass weatherCard = new WeatherCardClass(lWebscrapeData.TimeData[lTimeDataIndex],
                                                                    lWebscrapeData.TempData[lTimeDataIndex],
                                                                    lWebscrapeData.FeelData[lTimeDataIndex],
                                                                    lWebscrapeData.PrecipData[lTimeDataIndex],
                                                                    lWebscrapeData.WindData[lTimeDataIndex]);
                lWeatherCardList.Add(weatherCard);
            }
            ;

            return(lWeatherCardList);
        }