Exemple #1
0
 /// <summary>
 /// League constructor
 /// </summary>
 /// <param name="entriesA">JArray of LeagueItem entries</param>
 /// <param name="name">Name of league</param>
 /// <param name="queueString">Queue type as a string</param>
 /// <param name="tierString">Tier type as a string</param>
 public League(JArray entriesA, string name, string participantId, string queueString, string tierString)
 {
     entries = new List<LeagueEntry>();
     LoadEntries(entriesA);
     this.name = name;
     this.participantId = participantId;
     this.queueString = queueString;
     queue = GameConstants.SetQueue(queueString);
     this.tierString = tierString;
     tier = GameConstants.SetTier(tierString);
 }
Exemple #2
0
 /// <summary>
 /// League constructor
 /// </summary>
 /// <param name="entriesA">JArray of LeagueItem entries</param>
 /// <param name="name">Name of league</param>
 /// <param name="queueString">Queue type as a string</param>
 /// <param name="tierString">Tier type as a string</param>
 public League(JArray entriesA, string name, string participantId, string queueString, string tierString)
 {
     entries = new List <LeagueEntry>();
     if (entriesA != null)
     {
         LoadEntries(entriesA);
     }
     this.name          = name;
     this.participantId = participantId;
     this.queueString   = queueString;
     queue           = GameConstants.SetQueue(queueString);
     this.tierString = tierString;
     tier            = GameConstants.SetTier(tierString);
 }
Exemple #3
0
 public MatchReferenceAdvanced(long champion,
                               string lane,
                               long matchId,
                               string platformId,
                               string queue,
                               string role,
                               string season,
                               long timestamp)
 {
     this.champion      = champion;
     this.laneString    = lane;
     this.lane          = AdvancedMatchHistoryConstants.SetLane(lane);
     this.matchId       = matchId;
     this.platformId    = platformId;
     this.queueString   = queue;
     this.queue         = GameConstants.SetQueue(queue);
     this.roleString    = role;
     this.role          = AdvancedMatchHistoryConstants.SetRole(role);
     this.seasonString  = season;
     this.season        = AdvancedMatchHistoryConstants.SetSeason(season);
     this.timestampLong = timestamp;
     this.timestamp     = CreepScore.EpochToDateTime(timestamp);
 }
Exemple #4
0
        public async Task <League> RetrieveChallengerLeague(CreepScore.Region region, GameConstants.Queue queue)
        {
            Url url = UrlConstants.UrlBuilder(region, UrlConstants.leagueAPIVersion, UrlConstants.leaguePart).AppendPathSegment("challenger");

            url.SetQueryParams(new
            {
                type    = GameConstants.GetQueue(queue),
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            await GetPermission(region);

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadLeague(JObject.Parse(responseString)));
        }