コード例 #1
0
        List <CurrentGameInfoLive> LoadGameList(JArray a)
        {
            List <CurrentGameInfoLive> tmp = new List <CurrentGameInfoLive>();

            foreach (JObject o in a)
            {
                tmp.Add(HelperMethods.LoadCurrentGameInfo(o));
            }
            return(tmp);
        }
コード例 #2
0
ファイル: Summoner.cs プロジェクト: golf1052/CreepScore
        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)));
        }