BuildQueuesString() public static method

public static BuildQueuesString ( List queues ) : string
queues List
return string
Esempio n. 1
0
        /// <summary>
        /// Get the mach history of a specific summoner asynchronously.
        /// </summary>
        /// <param name="region">Region in which the summoner is.</param>
        /// <param name="summonerId">Summoner ID for which you want to retrieve the match history.</param>
        /// <param name="beginIndex">The begin index to use for fetching games.
        /// endIndex - beginIndex has to be inferior to 15.</param>
        /// <param name="endIndex">The end index to use for fetching games.
        /// endIndex - beginIndex has to be inferior to 15.</param>
        /// <param name="championIds">List of champion IDs to use for fetching games.</param>
        /// <param name="rankedQueues">List of ranked queue types to use for fetching games. Non-ranked queue types
        /// will be ignored.</param>
        /// <returns>A list of match summaries object.</returns>
        public async Task <List <MatchSummary> > GetMatchHistoryAsync(Region region, long summonerId,
                                                                      int beginIndex         = 0, int endIndex = 14,
                                                                      List <int> championIds = null, List <Queue> rankedQueues = null)
        {
            var addedArguments = new List <string> {
                string.Format("beginIndex={0}", beginIndex),
                string.Format("endIndex={0}", endIndex),
            };

            if (championIds != null)
            {
                addedArguments.Add(string.Format("championIds={0}", Util.BuildIdsString(championIds)));
            }
            if (rankedQueues != null)
            {
                addedArguments.Add(string.Format("rankedQueues={0}", Util.BuildQueuesString(rankedQueues)));
            }

            var json = await requester.CreateRequestAsync(
                string.Format(MatchHistoryRootUrl, region.ToString()) + string.Format(IdUrl, summonerId),
                region,
                addedArguments);

            return(await Task.Factory.StartNew(() =>
                                               JsonConvert.DeserializeObject <PlayerHistory>(json).Matches));
        }
Esempio n. 2
0
        /// <summary>
        /// Get the list of matches of a specific summoner synchronously.
        /// </summary>
        /// <param name="region">Region in which the summoner is.</param>
        /// <param name="summonerId">Summoner ID for which you want to retrieve the match list.</param>
        /// <param name="championIds">List of champion IDS to use for fetching games.</param>
        /// <param name="rankedQueues">List of ranked queue types to use for fetching games. Non-ranked queue types
        ///  will be ignored.</param>
        /// <param name="seasons">List of seasons for which to filter the match list by.</param>
        /// <param name="beginTime">The earliest date you wish to get matches from.</param>
        /// <param name="endTime">The latest date you wish to get matches from.</param>
        /// <param name="beginIndex">The begin index to use for fetching matches.</param>
        /// <param name="endIndex">The end index to use for fetching matches.</param>
        /// <returns>A list of Match references object.</returns>
        public MatchlistDto GetMacthAllByAccountId(Region region, long accountId, List <long> championIds = null, List <string> rankedQueues = null,
                                                   List <Season> seasons = null, DateTime?beginTime = null, DateTime?endTime = null,
                                                   int?beginIndex        = null, int?endIndex = null)
        {
            var addedArguments = new List <string> {
                string.Format("beginIndex={0}", beginIndex),
                string.Format("endIndex={0}", endIndex),
            };

            if (beginTime != null)
            {
                addedArguments.Add(string.Format("beginTime={0}", beginTime.Value.ToLong()));
            }
            if (endTime != null)
            {
                addedArguments.Add(string.Format("endTime={0}", endTime.Value.ToLong()));
            }
            if (championIds != null)
            {
                addedArguments.Add(string.Format("championIds={0}", Util.BuildIdsString(championIds)));
            }
            if (rankedQueues != null)
            {
                addedArguments.Add(string.Format("rankedQueues={0}", Util.BuildQueuesString(rankedQueues)));
            }
            if (seasons != null)
            {
                addedArguments.Add(string.Format("seasons={0}", Util.BuildSeasonString(seasons)));
            }

            var json = requester.CreateGetRequest(
                string.Format(Match_V3_RootUrl + MatchAllList_V3_ByAccountIdUrl, accountId),
                region,
                addedArguments,
                usePlatforms: true);

            return(JsonConvert.DeserializeObject <MatchlistDto>(json));

            //var json = requester.CreateGetRequest(
            //    string.Format(Match_V3_RootUrl + MatchAllList_V3_ByAccountIdUrl, accountId),
            //    region, usePlatforms: true);

            //return JsonConvert.DeserializeObject<MatchlistDto>(json);
        }