Пример #1
0
        private static List <PlaylistStats> ParsePlayListData(JObject playListsJson)
        {
            int                  season;
            int                  rankPoints;
            int                  matchesPlayed;
            int                  tier;
            int                  division;
            PlaylistStats        playList;
            List <PlaylistStats> playLists = new List <PlaylistStats>();

            foreach (KeyValuePair <string, JToken> seasonObject in playListsJson)
            {
                season = Int32.Parse(seasonObject.Key);
                foreach (JProperty playListObject in seasonObject.Value.Children())
                {
                    Int32 playlistID = Int32.Parse(playListObject.Name);
                    rankPoints    = (int)playListObject.Value["rankPoints"];
                    matchesPlayed = (int)playListObject.Value["matchesPlayed"];
                    tier          = (int)playListObject.Value["tier"];
                    division      = (int)playListObject.Value["division"];
                    playList      = new PlaylistStats(season, playlistID, rankPoints, matchesPlayed, tier, division);
                    playLists.Add(playList);
                }
            }

            return(playLists);
        }
Пример #2
0
        public List <PlaylistStats> CheckMatchCounts()
        {
            List <PlaylistStats> updatedPlayLists = new List <PlaylistStats>();
            int currentSeason;

            foreach (PlaylistStats playlist in playListStats)
            {
                currentSeason = PlaylistStats.GetCurrentSeason(playlist.GetPlayListId());
                if (playlist.GetSeasonNumber() >= currentSeason && playlist.CheckIfUpdated())
                {
                    updatedPlayLists.Add(playlist);
                }
            }
            return(updatedPlayLists);
        }