List <CurrentGameInfoLive> LoadGameList(JArray a) { List <CurrentGameInfoLive> tmp = new List <CurrentGameInfoLive>(); foreach (JObject o in a) { tmp.Add(HelperMethods.LoadCurrentGameInfo(o)); } return(tmp); }
public async Task <CurrentGameInfoLive> RetrieveCurrentGameInfo() { Url url = new Url(UrlConstants.GetBaseUrl(region)).AppendPathSegments(UrlConstants.observerModeRestpart, "/consumer/getSpectatorGameInfo/", UrlConstants.GetPlatformId(region), id.ToString()); url.SetQueryParams(new { api_key = CreepScore.apiKey }); Uri uri = new Uri(url.ToString()); await CreepScore.GetPermission(region); string responseString; try { responseString = await CreepScore.GetWebData(uri); } catch (CreepScoreException) { throw; } return(HelperMethods.LoadCurrentGameInfo(JObject.Parse(responseString))); }