public PlayerStatsSummaryList(JArray playerStatSummariesA, long summonerId, CreepScore.Season season) { playerStatSummaries = new List<PlayerStatsSummary>(); LoadPlayerStatSummaries(playerStatSummariesA); this.summonerId = summonerId; this.season = season; }
public PlayerStatsSummaryList(JArray playerStatSummariesA, long summonerId, CreepScore.Season season) { playerStatSummaries = new List <PlayerStatsSummary>(); LoadPlayerStatSummaries(playerStatSummariesA); this.summonerId = summonerId; this.season = season; }
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)); }
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."); } }
/// <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; }
/// <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; }
RankedStats LoadRankedStats(JObject o, CreepScore.Season season) { return(new RankedStats((JArray)o["champions"], (long)o["modifyDate"], (long)o["summonerId"], season)); }
PlayerStatsSummaryList LoadPlayerStatSummariesList(JObject o, CreepScore.Season season) { return(new PlayerStatsSummaryList((JArray)o["playerStatSummaries"], (long)o["summonerId"], season)); }