public static WhJsonMeta LoadMeta(string metaPath, string id) { var relativeUrl = $"meta/{metaPath}/{id}.json"; var url = GetModelViewerUrl(relativeUrl); var json = DataLoaderBase.LoadString(url, ".json"); return(JsonConvert.DeserializeObject <WhJsonMeta>(json)); }
public static WhJsonMeta LoadItemVisual(int id) { var relativeUrl = $"meta/itemvisual/{id}.json"; var url = GetModelViewerUrl(relativeUrl); var json = DataLoaderBase.LoadString(url, ".json"); return(JsonConvert.DeserializeObject <WhJsonMeta>(json)); }
public static WhJsonCustomizationData LoadMetaCharacterCustomization(WhRace race, WhGender gender) { var relativeUrl = $"meta/charactercustomization/{(int)race}_{(int)gender}.json"; var url = GetModelViewerUrl(relativeUrl); var json = DataLoaderBase.LoadString(url, ".json"); return(JsonConvert.DeserializeObject <WhJsonCustomizationData>(json)); }
/// <summary> /// Работает аналогично WH.Gatherer.fetchItems, чтобы получить данные по переданным итемам /// </summary> public static Dictionary <string, WhJsonGathererItem> LoadItemsFromGatherer(string[] itemIds) { if (itemIds == null || itemIds.Length == 0) { return(new Dictionary <string, WhJsonGathererItem>(0)); } itemIds = itemIds.OrderBy(x => x).ToArray(); var relativeUrl = $"/gatherer?items={string.Join(",", itemIds)}"; var url = GetWowheadUrl(relativeUrl); var javascriptCode = DataLoaderBase.LoadString(url, ".js"); var itemsJson = JavaScriptDigger.GetItemsFromGathererResult(javascriptCode); return(JsonConvert.DeserializeObject <Dictionary <string, WhJsonGathererItem> >(itemsJson)); }