/// <summary> /// Get ranked stats by summoner ID asynchronously. /// </summary> /// <param name="region">Region where to retrieve the data.</param> /// <param name="summonerId">ID of the summoner for which to retrieve ranked stats.</param> /// <param name="season">If specified, stats for the given season are returned. /// Otherwise, stats for the current season are returned.</param> /// <returns>A list of champion stats.</returns> public async Task<List<ChampionStats>> GetStatsRankedAsync(Region region, long summonerId, StatsEndpoint.Season season) { var json = await requester.CreateRequestAsync( string.Format(StatsRootUrl, region) + string.Format(StatsRankedUrl, summonerId), region, new List<string> { string.Format("season={0}", season.ToString().ToUpper()) }); return (await Task.Factory.StartNew(() => JsonConvert.DeserializeObject<RankedStats>(json))).ChampionStats; }
/// <summary> /// Get player stats by summoner ID synchronously. /// </summary> /// <param name="region">Region where to retrieve the data.</param> /// <param name="summonerId">ID of the summoner for which to retrieve player stats.</param> /// <param name="season">If specified, stats for the given season are returned. /// Otherwise, stats for the current season are returned.</param> /// <returns>A list of player stats summaries.</returns> public List<PlayerStatsSummary> GetStatsSummaries(Region region, long summonerId, StatsEndpoint.Season season) { var json = requester.CreateRequest( string.Format(StatsRootUrl, region) + string.Format(StatsSummaryUrl, summonerId), region, new List<string> { string.Format("season={0}", season.ToString().ToUpper()) }); return JsonConvert.DeserializeObject<PlayerStatsSummaryList>(json).PlayerStatSummaries; }
/// <summary> /// Get ranked stats by summoner ID synchronously. /// </summary> /// <param name="region">Region where to retrieve the data.</param> /// <param name="summonerId">ID of the summoner for which to retrieve ranked stats.</param> /// <param name="season">If specified, stats for the given season are returned. /// Otherwise, stats for the current season are returned.</param> /// <returns>A list of champion stats.</returns> public List<ChampionStats> GetStatsRanked(Region region, long summonerId, StatsEndpoint.Season season) { var json = requester.CreateRequest( string.Format(StatsRootUrl, region) + string.Format(StatsRankedUrl, summonerId), region, new List<string> { string.Format("season={0}", season.ToString().ToUpper()) }); return JsonConvert.DeserializeObject<RankedStats>(json).ChampionStats; }
/// <summary> /// Get player stats summaries for this summoner asynchronously. One summary is returned per queue type. /// </summary> /// <param name="season">Season for which you want the stats.</param> /// <returns>A list of player stats summaries.</returns> public async Task<List<PlayerStatsSummary>> GetStatsSummariesAsync(StatsEndpoint.Season season) { var json = await requester.CreateGetRequestAsync( string.Format(StatsRootUrl, Region) + string.Format(StatsSummaryUrl, Id), Region, new List<string> { string.Format("season={0}", season.ToString().ToUpper()) }); return (await Task.Factory.StartNew(() => JsonConvert.DeserializeObject<PlayerStatsSummaryList>(json))).PlayerStatSummaries; }