Beispiel #1
0
        /// <summary>
        /// Get list of summoner names by summoner IDs asynchronously
        /// </summary>
        /// <param name="summonerIds">Comma-separated list of summoner IDs associated with summoner names to retrieve. Maximum allowed at once is 40.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>The task containing a list of summoner name information </returns>
        public Task <SummonerNameListResult> GetSummonersAsync(string summonerIds, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <SummonerNameListResult> .CreateRequest(GetApiUri(api: "summoner", method: "name", summonerIds: summonerIds, region: region)));
            });

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Get recent games by summoner ID
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve recent games.</param>
        /// <param name="region">Region where to retrieve the data</param>
        /// <returns>The Summoners Recent Games</returns>
        public Task <RecentGamesResult> GetGamesBySummonerAsync(long summonerId, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <RecentGamesResult> .CreateRequest(GetApiUri(api: "game", region: region, summonerId: summonerId)));
            });

            return(result);
        }
Beispiel #3
0
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve player stats.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <param name="season">If specified, stats for the given season are returned. Otherwise, stats for the current season are returned.</param>
        /// <returns>Player stats summary result</returns>
        public Task <PlayerStatsSummaryResult> GetPlayerStatsSummaryAsync(long summonerId, string region = null, string season = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <PlayerStatsSummaryResult> .CreateRequest(GetApiUri(api: "stats", region: region, summonerId: summonerId, season: season)));
            });

            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// Retrieves leagues data for summoner asynchronously, including leagues for all of summoner's teams
        /// </summary>
        /// <param name="summonerId">Summoner ID</param>
        /// <param name="region">The region of the leagues</param>
        /// <returns>A dictonary with the key as league name, and the value the League DTO</returns>
        public Task <LeagueResult> GetLeagueBySummonerAsync(long summonerId, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <LeagueResult> .CreateRequest(GetApiUri(api: "league", region: region, summonerId: summonerId, version: "v2.1")));
            });

            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// Retrieves teams for given summoner ID aynchronously
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve player stats.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>A task with the summoner teams in the result</returns>
        public Task <TeamResult> GetSummonerTeamsAsync(long summonerId, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <TeamResult> .CreateRequest(GetApiUri(api: "team", version: "v2.1", region: region, summonerId: summonerId)));
            });

            return(result);
        }
Beispiel #6
0
        /// <summary>
        /// Get rune pages by summoner ID asynchronously
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve rune pages.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>Task containing the rune pages result</returns>
        public Task <RunePagesResult> GetSummonerRunesAsync(long summonerId, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <RunePagesResult> .CreateRequest(GetApiUri(api: "summoner", method: "runes", region: region, summonerId: summonerId)));
            });

            return(result);
        }
Beispiel #7
0
        /// <summary>
        /// Get summoner by summoner ID asynchronously
        /// </summary>
        /// <param name="summonerId">ID of the summoner to retrieve</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>A Summoner task</returns>
        public Task <SummonerDto> GetSummonerAsync(long summonerId, string region = null)
        {
            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <SummonerDto> .CreateRequest(GetApiUri(api: "summoner", summonerId: summonerId, region: region)));
            });

            return(result);
        }
Beispiel #8
0
        /// <summary>
        /// Retrieve all champions
        /// </summary>
        /// <param name="region">The region of the leagues</param>
        /// <param name="freeToPlay">Optional filter param to retrieve only free to play champions.</param>
        /// <returns>Champions result</returns>
        public ChampionsResult GetChampions(string region = null, bool freeToPlay = false)
        {
            if (ApiCache.Instance.CachingEnabled && ApiCache.Instance.Champions.Count > 0)
            {
                return(new ChampionsResult {
                    Champions = ApiCache.Instance.Champions
                });
            }

            var result = JsonWebRequest <ChampionsResult> .CreateRequest(GetApiUri(api : "champion", freeToPlay : freeToPlay));

            if (ApiCache.Instance.CachingEnabled)
            {
                ApiCache.Instance.Champions = result.Champions;
            }
            return(result);
        }
Beispiel #9
0
        /// <summary>
        /// Retrieve all champions asynchronously
        /// </summary>
        /// <param name="region">The region of the leagues</param>
        /// <param name="freeToPlay">Optional filter param to retrieve only free to play champions.</param>
        /// <returns>Champion list task containing the result</returns>
        public Task <ChampionsResult> GetChampionsAsync(string region = null, bool freeToPlay = false)
        {
            if (ApiCache.Instance.CachingEnabled && ApiCache.Instance.Champions.Count > 0)
            {
                return(Task.Factory.StartNew(() =>
                {
                    return new ChampionsResult {
                        Champions = ApiCache.Instance.Champions
                    };
                }));
            }

            var result = Task.Factory.StartNew(() =>
            {
                return(JsonWebRequest <ChampionsResult> .CreateRequest(GetApiUri(api: "champion", freeToPlay: freeToPlay)));
            });

            if (ApiCache.Instance.CachingEnabled)
            {
                ApiCache.Instance.Champions = result.Result.Champions;
            }

            return(result);
        }
Beispiel #10
0
        /// <summary>
        /// Get recent games by summoner ID
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve recent games.</param>
        /// <param name="region">Region where to retrieve the data</param>
        /// <returns>The Summoners Recent Games</returns>
        public RecentGamesResult GetGamesBySummoner(long summonerId, string region = null)
        {
            var result = JsonWebRequest <RecentGamesResult> .CreateRequest(GetApiUri(api : "game", region : region, summonerId : summonerId));

            return(result);
        }
Beispiel #11
0
        /// <summary>
        /// Get player stats summaries by summoner ID. One summary is returned per queue type
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve player stats.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <param name="season">If specified, stats for the given season are returned. Otherwise, stats for the current season are returned.</param>
        /// <returns>Player stats summary result</returns>
        public PlayerStatsSummaryResult GetPlayerStatsSummary(long summonerId, string region = null, string season = null)
        {
            var result = JsonWebRequest <PlayerStatsSummaryResult> .CreateRequest(GetApiUri(api : "stats", region : region, summonerId : summonerId, season : season));

            return(result);
        }
Beispiel #12
0
        /// <summary>
        /// Retrieves leagues data for summoner, including leagues for all of summoner's teams
        /// </summary>
        /// <param name="summonerId">Summoner ID</param>
        /// <param name="region">The region of the leagues</param>
        /// <returns>A dictonary with the key as league name, and the value the League DTO</returns>
        public LeagueResult GetLeagueBySummoner(long summonerId, string region = null)
        {
            var result = JsonWebRequest <LeagueResult> .CreateRequest(GetApiUri(api : "league", region : region, summonerId : summonerId, version : "v2.1"));

            return(result);
        }
Beispiel #13
0
        /// <summary>
        /// Retrieves teams for given summoner ID
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve player stats.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>The summoners teams</returns>
        public TeamResult GetSummonerTeams(long summonerId, string region = null)
        {
            var result = JsonWebRequest <TeamResult> .CreateRequest(GetApiUri(api : "team", version : "v2.1", region : region, summonerId : summonerId));

            return(result);
        }
Beispiel #14
0
        /// <summary>
        /// Get rune pages by summoner ID
        /// </summary>
        /// <param name="summonerId">ID of the summoner for which to retrieve rune pages.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>The rune pages result</returns>
        public RunePagesResult GetSummonerRunes(long summonerId, string region = null)
        {
            var result = JsonWebRequest <RunePagesResult> .CreateRequest(GetApiUri(api : "summoner", method : "runes", region : region, summonerId : summonerId));

            return(result);
        }
Beispiel #15
0
        /// <summary>
        /// Get list of summoner names by summoner ID
        /// </summary>
        /// <param name="summonerIds">Comma-separated list of summoner IDs associated with summoner names to retrieve. Maximum allowed at once is 40.</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>The list of summoner name information.</returns>
        public SummonerNameListResult GetSummoners(string summonerIds, string region = null)
        {
            var result = JsonWebRequest <SummonerNameListResult> .CreateRequest(GetApiUri(api : "summoner", method : "name", summonerIds : summonerIds, region : region));

            return(result);
        }
Beispiel #16
0
        /// <summary>
        /// Get summoner by summoner ID
        /// </summary>
        /// <param name="summonerId">ID of the summoner to retrieve</param>
        /// <param name="region">Region where to retrieve the data.</param>
        /// <returns>A Summoner</returns>
        public SummonerDto GetSummoner(long summonerId, string region = null)
        {
            var result = JsonWebRequest <SummonerDto> .CreateRequest(GetApiUri(api : "summoner", summonerId : summonerId, region : region));

            return(result);
        }