public async Task <MasteryStatic> RetrieveMasteryData(CreepScore.Region region, int id, StaticDataConstants.MasteryListData masteryListData, string locale = "", string version = "") { Url url = UrlConstants.StaticDataUrlBuilder(region, UrlConstants.masteryPart).AppendPathSegment(id.ToString()); url.SetQueryParams(new { locale = locale, version = version, masteryListData = StaticDataConstants.GetMasteryListData(masteryListData), api_key = apiKey }); Uri uri = new Uri(url.ToString()); string responseString; try { responseString = await GetWebData(uri); } catch (CreepScoreException) { throw; } return(HelperMethods.LoadMasteryStatic(JObject.Parse(responseString))); }
Dictionary <string, MasteryStatic> LoadMasteryStatic(string s) { Dictionary <string, JObject> values = JsonConvert.DeserializeObject <Dictionary <string, JObject> >(s); Dictionary <string, MasteryStatic> tmp = new Dictionary <string, MasteryStatic>(); foreach (KeyValuePair <string, JObject> pair in values) { tmp.Add(pair.Key, HelperMethods.LoadMasteryStatic(pair.Value)); } return(tmp); }