Ejemplo n.º 1
0
 public bool IsAffix(ParsedAffix affix, out double normalizedWeight)
 {
     if (this.AffixCategory.Equals(affix.AffixCategory))
     {
         normalizedWeight = Normalize(affix.Value);
         return(true);
     }
     normalizedWeight = default(double);
     return(false);
 }
Ejemplo n.º 2
0
        public ParsedItem(bool corrupted, string[] implicitMods, string[] explicitMods)
        {
            this.Corrupted = corrupted;

            ParsedImplicitMods = new ParsedAffix[implicitMods.Length];
            for (int i = 0; i < implicitMods.Length; i++)
            {
                ParsedImplicitMods[i] = new ParsedAffix(implicitMods[i]);
            }

            ParsedExplicitMods = new ParsedAffix[explicitMods.Length];
            for (int i = 0; i < explicitMods.Length; i++)
            {
                ParsedExplicitMods[i] = new ParsedAffix(explicitMods[i]);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Update with information of an affix
        /// </summary>
        public void UpdateWith(ParsedAffix a)
        {
            if (!a.AffixCategory.Equals(this.AffixCategory))
            {
                throw new ArgumentException($"Can't update {AffixCategory} with a value of {a.AffixCategory}");
            }

            if (a.Value < MinValue)
            {
                MinValue = a.Value;
            }
            if (a.Value > MaxValue)
            {
                MaxValue = a.Value;
            }
        }