Created
February 3, 2014 05:05
-
-
Save efranford/8779097 to your computer and use it in GitHub Desktop.
Gets the highest tier a summoner has achieved in any game mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int GetHighestTier(int summonerId) | |
{ | |
var leagues = EF.RiotApi.Client.API.LeagueApi.Instance.GetLeagueBySummonerAsync(summonerId).Result; | |
int summoner1Tier = -1; | |
foreach (var league in leagues) | |
{ | |
var summoner1LeagueVar = league.Value; | |
if (summoner1LeagueVar.Tier.Contains("BRONZE")) | |
{ | |
summoner1Tier = 1; | |
} | |
else if (summoner1LeagueVar.Tier.Contains("SILVER")) | |
{ | |
summoner1Tier = 2; | |
} | |
else if (summoner1LeagueVar.Tier.Contains("GOLD")) | |
{ | |
summoner1Tier = 3; | |
} | |
else if (summoner1LeagueVar.Tier.Contains("PLATINUM")) | |
{ | |
summoner1Tier = 4; | |
} | |
else if (summoner1LeagueVar.Tier.Contains("DIAMOND")) | |
{ | |
summoner1Tier = 5; | |
} | |
else if (summoner1LeagueVar.Tier.Contains("CHALLENGER")) | |
{ | |
summoner1Tier = 6; | |
} | |
} | |
return summoner1Tier; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This runs perfectly thank you so much! The threading error was killing me .-.
I gave you credit in the code comments if anyone ever feels the need to decompile it :D