public PlayerStatsSummaryList(JArray playerStatSummariesA, long summonerId, CreepScore.Season season)
 {
     playerStatSummaries = new List<PlayerStatsSummary>();
     LoadPlayerStatSummaries(playerStatSummariesA);
     this.summonerId = summonerId;
     this.season = season;
 }
示例#2
0
 public PlayerStatsSummaryList(JArray playerStatSummariesA, long summonerId, CreepScore.Season season)
 {
     playerStatSummaries = new List <PlayerStatsSummary>();
     LoadPlayerStatSummaries(playerStatSummariesA);
     this.summonerId = summonerId;
     this.season     = season;
 }
示例#3
0
        public async Task <PlayerStatsSummaryList> RetrievePlayerStatsSummaries(CreepScore.Season season)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.statsAPIVersion, UrlConstants.statsPart)
                      .AppendPathSegments(UrlConstants.bySummonerPart, id.ToString(), UrlConstants.summaryPart);

            url.SetQueryParams(new
            {
                season  = CreepScore.GetSeason(season),
                api_key = CreepScore.apiKey
            });
            Uri uri = new Uri(url.ToString());
            await CreepScore.GetPermission(region);

            string responseString;

            try
            {
                responseString = await CreepScore.GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadPlayerStatSummariesList(JObject.Parse(responseString), season));
        }
示例#4
0
        public async Task <RankedStats> RetrieveRankedStats(CreepScore.Season season)
        {
            if (summonerLevel == 30)
            {
                Url url = UrlConstants.UrlBuilder(region, UrlConstants.statsAPIVersion, UrlConstants.statsPart)
                          .AppendPathSegments(UrlConstants.bySummonerPart, id.ToString(), UrlConstants.rankedPart);
                url.SetQueryParams(new
                {
                    season  = CreepScore.GetSeason(season),
                    api_key = CreepScore.apiKey
                });
                Uri uri = new Uri(url.ToString());
                await CreepScore.GetPermission(region);

                string responseString;
                try
                {
                    responseString = await CreepScore.GetWebData(uri);
                }
                catch (CreepScoreException)
                {
                    throw;
                }
                return(LoadRankedStats(JObject.Parse(responseString), season));
            }
            else
            {
                throw new CreepScoreException("The summoner is not level 30. They do not have ranked stats.");
            }
        }
示例#5
0
 /// <summary>
 /// RankedStats constructor
 /// </summary>
 /// <param name="championsA">JArray of champions</param>
 /// <param name="modifyDateLong">Date stats were last modified specified as epoch milliseconds</param>
 /// <param name="summonerId">Summoner ID</param>
 /// <param name="season">The season that represents this data</param>
 public RankedStats(JArray championsA, long modifyDateLong, long summonerId, CreepScore.Season season)
 {
     champions = new List<ChampionStats>();
     LoadChampions(championsA);
     this.modifyDateLong = modifyDateLong;
     modifyDate = CreepScore.EpochToDateTime(modifyDateLong);
     this.summonerId = summonerId;
     this.season = season;
 }
示例#6
0
 /// <summary>
 /// RankedStats constructor
 /// </summary>
 /// <param name="championsA">JArray of champions</param>
 /// <param name="modifyDateLong">Date stats were last modified specified as epoch milliseconds</param>
 /// <param name="summonerId">Summoner ID</param>
 /// <param name="season">The season that represents this data</param>
 public RankedStats(JArray championsA, long modifyDateLong, long summonerId, CreepScore.Season season)
 {
     champions = new List <ChampionStats>();
     LoadChampions(championsA);
     this.modifyDateLong = modifyDateLong;
     modifyDate          = CreepScore.EpochToDateTime(modifyDateLong);
     this.summonerId     = summonerId;
     this.season         = season;
 }
示例#7
0
 RankedStats LoadRankedStats(JObject o, CreepScore.Season season)
 {
     return(new RankedStats((JArray)o["champions"], (long)o["modifyDate"], (long)o["summonerId"], season));
 }
示例#8
0
 PlayerStatsSummaryList LoadPlayerStatSummariesList(JObject o, CreepScore.Season season)
 {
     return(new PlayerStatsSummaryList((JArray)o["playerStatSummaries"], (long)o["summonerId"], season));
 }