Example #1
0
        protected void RecalculateItem()
        {
            if (Monitor.IsBusy)
            {
                return;
            }

            Item.NameLine = "";
            Item.TypeLine = Item.BaseType.Name;

            var(explicitStats, craftedStats) = RecalculateItemSpecific(out var requiredLevel);

            Item.ExplicitMods = CreateItemMods(explicitStats).ToList();
            Item.CraftedMods  = CreateItemMods(craftedStats).ToList();
            Item.ImplicitMods = CreateItemMods(MsImplicits.SelectMany(ms => ms.GetStatValues())).ToList();

            var quality = SelectedBase.CanHaveQuality
                ? _qualitySlider.Value
                : 0;

            Item.Properties = new ObservableCollection <ItemMod>(Item.BaseType.GetRawProperties(quality));
            ApplyLocals();

            if (Item.IsWeapon)
            {
                ApplyElementalMods(Item.Mods);
            }

            if (MsImplicits.Any())
            {
                var implicits = MsImplicits.Select(ms => ms.Query());
                requiredLevel = Math.Max(requiredLevel, implicits.Max(m => m.RequiredLevel));
            }
            Item.UpdateRequirements((80 * requiredLevel) / 100);
        }
        protected void RecalculateItem()
        {
            if (Monitor.IsBusy)
            {
                return;
            }

            Item.NameLine    = "";
            Item.TypeLine    = Item.BaseType.Name;
            Item.FlavourText = "Created with PoESkillTree";

            int requiredLevel;
            var statLookup = RecalculateItemSpecific(out requiredLevel).ToList();

            Item.ExplicitMods = CreateItemMods(ModLocation.Explicit,
                                               statLookup.SingleOrDefault(g => g.Key == ModLocation.Explicit)).ToList();
            Item.CraftedMods = CreateItemMods(ModLocation.Crafted,
                                              statLookup.SingleOrDefault(g => g.Key == ModLocation.Crafted)).ToList();
            Item.ImplicitMods = CreateItemMods(ModLocation.Implicit,
                                               MsImplicits.SelectMany(ms => ms.GetStatValues())).ToList();

            var quality = SelectedBase.CanHaveQuality
                ? _qualitySlider.Value
                : 0;

            Item.Properties = new ObservableCollection <ItemMod>(Item.BaseType.GetRawProperties(quality));
            ApplyLocals();

            if (Item.IsWeapon)
            {
                ApplyElementalMods(Item.Mods);
            }

            if (MsImplicits.Any())
            {
                var implicits = MsImplicits.Select(ms => ms.Query());
                requiredLevel = Math.Max(requiredLevel, implicits.Max(m => m.RequiredLevel));
            }
            Item.UpdateRequirements((80 * requiredLevel) / 100);
        }