/// <summary>
/// Looks up a champion with the specified id.
/// </summary>
/// <param name="region">The region to check</param>
/// <param name="championId">id of the champion to look up</param>
/// <remarks>Version 1.2</remarks>
/// <returns></returns>
public Champion GetChampion(int championId)
{
Champion championCall = new Champion();
Champion staticChampionCall = new Champion();
DataContractJsonSerializer jSerializer = new DataContractJsonSerializer(typeof(Champion));
WebClient webClient = new WebClient();
try
{
championCall = (Champion)jSerializer.ReadObject(webClient.OpenRead(String.Format("https://{0}.api.pvp.net/api/lol/{0}/v1.2/champion/{1}?api_key={2}", _region, championId, _apiKey)));
staticChampionCall = (Champion)jSerializer.ReadObject(webClient.OpenRead(string.Format("https://{0}.api.pvp.net/api/lol/static-data/{0}/v1.2/champion/{1}?champData=all&api_key={2}", _region, championId, _apiKey)));
staticChampionCall.Active = championCall.Active;
staticChampionCall.BotEnabled = championCall.BotEnabled;
staticChampionCall.BotMmEnabled = championCall.BotMmEnabled;
staticChampionCall.FreeToPlay = championCall.FreeToPlay;
staticChampionCall.RankedPlayEnabled = championCall.RankedPlayEnabled;
}
catch (WebException e)
{
throw;
}
return staticChampionCall;
}