Example #1
0
        private async Task <IReadOnlyList <UniqueBase> > LoadUniques()
        {
            var metadataToBase = ItemBases.ToDictionary(b => b.MetadataId);
            var xmlList        = await DataUtils.LoadXmlAsync <XmlUniqueList>("Uniques.xml", true);

            return(xmlList.Uniques.Select(
                       x => new UniqueBase(_itemImageService, ModDatabase, metadataToBase[x.BaseMetadataId], x)).ToList());
        }
Example #2
0
        private async Task <IEnumerable <UniqueBase> > LoadUniques()
        {
            var metadataToBase = ItemBases.ToDictionary(b => b.MetadataId);
            var xmlList        = await DeserializeResourceAsync <XmlUniqueList>("Uniques.xml");

            return(xmlList.Uniques.Select(
                       x => new UniqueBase(_itemImageService, metadataToBase[x.BaseMetadataId], x)));
        }
Example #3
0
        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));
        }
Example #4
0
        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));
        }
Example #5
0
        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));
        }