//Get and set the selected Season private void setSeason() { string item = seasonBox.SelectedItem.ToString(); if (item == "Season 2") { season_set = true; s = RlsSeason.Two; getRanksFromSeason(s); } if (item == "Season 3") { season_set = true; s = RlsSeason.Three; getRanksFromSeason(s); } if (item == "Season 4") { season_set = true; s = RlsSeason.Four; getRanksFromSeason(s); } if (item == "Season 5") { season_set = true; s = RlsSeason.Five; getRanksFromSeason(s); } if (item == "Season 6") { season_set = true; s = RlsSeason.Six; getRanksFromSeason(s); } if (item == "Season 7") { season_set = true; s = RlsSeason.Seven; getRanksFromSeason(s); } }
//Get the ranks from the selected season private void getRanksFromSeason(RlsSeason s) { if (season_set && Player_Name_Platform.player_set) { player = Player_Name_Platform.player; var playerSeason = player.RankedSeasons.FirstOrDefault(x => x.Key == s); if (playerSeason.Value != null) { foreach (var playerRank in playerSeason.Value) { setRank(playerRank.Key.ToString(), (int)playerRank.Value.Tier); setInfo(playerRank.Key.ToString(), (int)playerRank.Value.Division + 1, playerRank.Value.RankPoints, (int)playerRank.Value.MatchesPlayed); } } } }
/// <summary> /// Retrieves the latest tier data. /// </summary> /// <param name="season">The <see cref="RlsSeason"/> you want tier data from.</param> /// <returns></returns> public async Task <Tier[]> GetTiersAsync(RlsSeason season) { return(await _api.Get <Tier[]>($"data/tiers/{(int)season}")); }