Exemple #1
0
        public async Task <ChampionListStatic> RetrieveChampionsData(CreepScore.Region region, StaticDataConstants.ChampData champData, string locale = "", string version = "", bool dataById = false)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.championPart);

            url.SetQueryParams(new
            {
                locale    = locale,
                version   = version,
                dataById  = dataById.ToString(),
                champData = StaticDataConstants.GetChampData(champData),
                api_key   = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadChampionListStatic(JObject.Parse(responseString)));
        }
Exemple #2
0
        public async Task <SummonerSpellStatic> RetrieveSummonerSpellData(CreepScore.Region region, int id, StaticDataConstants.SpellData spellData, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.summonerSpellPart).AppendPathSegment(id.ToString());

            url.SetQueryParams(new
            {
                locale    = locale,
                version   = version,
                spellData = StaticDataConstants.GetSpellData(spellData),
                api_key   = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadSummonerSpellStatic(JObject.Parse(responseString)));
        }
Exemple #3
0
        public async Task <RuneListStatic> RetrieveRunesData(CreepScore.Region region, StaticDataConstants.RuneListData runeListData, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.runePart);

            url.SetQueryParams(new
            {
                locale       = locale,
                version      = version,
                runeListData = StaticDataConstants.GetRuneListData(runeListData),
                api_key      = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadRuneListStatic(JObject.Parse(responseString)));
        }
Exemple #4
0
        public async Task <List <string> > RetrieveVersions(CreepScore.Region region)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.versionsPart);

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadStrings(JArray.Parse(responseString)));
        }
Exemple #5
0
        public async Task <RealmStatic> RetrieveRealmData(CreepScore.Region region)
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.realmPart);

            url.SetQueryParams(new
            {
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(LoadRealmData(JObject.Parse(responseString)));
        }
Exemple #6
0
        public async Task <LanguageStringsStatic> RetrieveLanguageStrings(CreepScore.Region region, string locale = "", string version = "")
        {
            Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.languageStringsPart);

            url.SetQueryParams(new
            {
                locale  = locale,
                version = version,
                api_key = apiKey
            });
            Uri uri = new Uri(url.ToString());

            string responseString;

            try
            {
                responseString = await GetWebData(uri);
            }
            catch (CreepScoreException)
            {
                throw;
            }
            return(HelperMethods.LoadLanguageStringsStatic(JObject.Parse(responseString)));
        }