public JewelOverrideViewModel(DecorationsOverrideViewModel parent, IJewel jewel, int count)
        {
            this.parent = parent;
            this.jewel  = jewel;

            Name      = jewel.Name;
            SlotSize  = jewel.SlotSize;
            Abilities = jewel.Abilities.Select(x => new JewelAbilityViewModel(x, count)).ToList();
        }
示例#2
0
 public void AddJewel(IJewel jewel)
 {
     if (jewel.Name == "Gold" && this.JewelsTaken.Any(x => x.Name == "Gold"))
     {
         this.JewelsTaken.FirstOrDefault(x => x.Name == "Gold").Amount += jewel.Amount;
     }
     else
     {
         this.JewelsTaken.Add(jewel);
     }
 }
示例#3
0
 private JewelPrimitive ConvertJewel(IJewel jewel)
 {
     return(new JewelPrimitive
     {
         Id = jewel.Id,
         Name = jewel.Name,
         Rarity = jewel.Rarity,
         SlotSize = jewel.SlotSize,
         Abilitites = jewel.Abilities.Select(x => new AbilityIdPrimitive {
             SkillId = x.Skill.Id, Level = x.Level
         }).ToList()
     });
 }
        private SolverDataJewelModel CreateSolverDataJewelModel(IJewel jewel)
        {
            DecorationOverrideConfigurationV2 decorationOverrideConfig = GlobalData.Instance.Configuration.InParameters?.DecorationOverride;

            if (decorationOverrideConfig != null && decorationOverrideConfig.UseOverride)
            {
                Dictionary <string, DecorationOverrideConfigurationItem> decoOverrides = decorationOverrideConfig?.Items;

                if (decoOverrides != null)
                {
                    if (decoOverrides.TryGetValue(Localization.GetDefault(jewel.Name), out DecorationOverrideConfigurationItem found) && found.IsOverriding)
                    {
                        return(new SolverDataJewelModel(jewel, found.Count));
                    }
                }
            }

            return(new SolverDataJewelModel(jewel, int.MaxValue));
        }
示例#5
0
        private bool TrySlotJewels(MappedJewel mappedJewel, int[] totalSlots, int[] remainingLevels, out ArmorSetJewelResult jewelResult)
        {
            jewelResult = new ArmorSetJewelResult();

            IJewel      jewel         = mappedJewel.Jewel.Jewel;
            MappedSkill ability       = mappedJewel.Skill;
            int         mappedId      = ability.MappedId;
            int         needLevels    = remainingLevels[mappedId];
            int         needJewels    = needLevels;
            int         canTakeJewels = Math.Min(mappedJewel.Jewel.Available, needJewels);

            if (canTakeJewels < needJewels)
            {
                return(false);
            }

            int jewelsTaken = 0;

            for (int slot = jewel.SlotSize; slot <= CutoffSearchConstants.Slots && jewelsTaken < needJewels; ++slot)
            {
                int sizeSlotsAvailable = totalSlots[slot];
                int canFitToSlot       = Math.Min(sizeSlotsAvailable, canTakeJewels);
                totalSlots[slot] -= canFitToSlot;
                canTakeJewels    -= canFitToSlot;
                jewelsTaken      += canFitToSlot;
            }

            if (jewelsTaken < needJewels)
            {
                return(false);
            }

            remainingLevels[mappedId] -= jewelsTaken;

            jewelResult.Jewel = jewel;
            jewelResult.Count = jewelsTaken;
            return(true);
        }
示例#6
0
        private static bool Equals(IJewel x, IJewel y)
        {
            if (x.Id != y.Id)
            {
                return(false);
            }

            if (x.Name != y.Name)
            {
                return(false);
            }

            if (x.Rarity != y.Rarity)
            {
                return(false);
            }

            if (x.SlotSize != y.SlotSize)
            {
                return(false);
            }

            if (x.Abilities.Length != y.Abilities.Length)
            {
                return(false);
            }

            for (int i = 0; i < x.Abilities.Length; i++)
            {
                if (Equals(x.Abilities[i], y.Abilities[i]) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
 private bool DecorationMatchInParameters(IJewel jewel)
 {
     return(jewel.Rarity <= InParameters.Rarity);
 }
示例#8
0
 public ArmorSetJewelViewModel(IJewel jewel, int count)
 {
     this.jewel = jewel;
     this.count = count;
 }
示例#9
0
 public SolverDataJewelModel(IJewel jewel, int available)
 {
     Jewel     = jewel;
     Available = available;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Sword"/> class.
 /// </summary>
 /// <param name="jewel">The grand weapon.</param>
 public Sword(IJewel jewel)
 {
     this.Jewel = jewel;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NamedSword"/> class.
 /// </summary>
 /// <param name="name">The name of the weapon.</param>
 /// <param name="jewel">A enhancement for a weapon.</param>
 public NamedSword(string name, IJewel jewel)
     : base(jewel)
 {
     this.Name = name;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NamedSword"/> class.
 /// </summary>
 /// <param name="name">The name of the weapon.</param>
 /// <param name="jewel">A enhancement for a weapon.</param>
 public NamedSword(string name, IJewel jewel)
     : base(jewel)
 {
     this.Name = name;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Sword"/> class.
 /// </summary>
 /// <param name="jewel">The grand weapon.</param>
 public Sword(IJewel jewel)
 {
     this.Jewel = jewel;
 }