private async Task InitializeAsync() { AffixesPerItemType = (from a in await LoadAffixes() group a by a.ItemType into types select types) .ToDictionary(g => g.Key, g => (IReadOnlyList <Affix>) new List <Affix>(g)); ItemBases = (await LoadBases()).ToList(); UniqueBases = (await LoadUniques()).ToList(); ItemBaseDictionary = ItemBases.DistinctBy(b => b.Name).ToDictionary(b => b.Name); UniqueBaseDictionary = UniqueBases.DistinctBy(b => b.UniqueName).ToDictionary(b => b.UniqueName); _root = new WordSetTreeNode(ItemBases.Select(m => m.Name)); }
private async Task InitializeAsync() { var modsTask = DataUtils.LoadRePoEAsync <Dictionary <string, JsonMod> >("mods"); var benchOptionsTask = DataUtils.LoadRePoEAsync <JsonCraftingBenchOption[]>("crafting_bench_options"); var npcMastersTask = DataUtils.LoadRePoEAsync <Dictionary <string, JsonNpcMaster> >("npc_master"); var statTranslationsTask = DataUtils.LoadRePoEAsync <List <JsonStatTranslation> >("stat_translations"); ModDatabase = new ModDatabase(await modsTask, await benchOptionsTask, await npcMastersTask); StatTranslator = new StatTranslator(await statTranslationsTask); ItemBases = (await LoadBases()).ToList(); UniqueBases = (await LoadUniques()).ToList(); ItemBaseDictionary = ItemBases.DistinctBy(b => b.Name).ToDictionary(b => b.Name); UniqueBaseDictionary = UniqueBases.DistinctBy(b => b.UniqueName).ToDictionary(b => b.UniqueName); _root = new WordSetTreeNode(ItemBases.Select(m => m.Name)); }
private async Task InitializeAsync() { var modsTask = DataUtils.LoadRePoEAsync <Dictionary <string, JsonMod> >("mods", true); var benchOptionsTask = DataUtils.LoadRePoEAsync <JsonCraftingBenchOption[]>("crafting_bench_options", true); var statTranslatorTask = StatTranslators.CreateFromMainFileAsync(true); ModDatabase = new ModDatabase(await modsTask, await benchOptionsTask); ItemBases = await LoadBases(); UniqueBases = await LoadUniques(); StatTranslator = await statTranslatorTask; ItemBaseDictionary = ItemBases.DistinctBy(b => b.Name).ToDictionary(b => b.Name); UniqueBaseDictionary = UniqueBases.DistinctBy(b => b.UniqueName).ToDictionary(b => b.UniqueName); _root = new WordSetTreeNode(ItemBases.Select(m => m.Name)); }