Example #1
0
        public ConfigValue Overlap(ConfigValue overlapper, bool forceType = false)
        {
            if (!forceType)
            {
                if (typeIndex != overlapper.typeIndex)
                {
                    return(null);
                }
            }

            return(new ConfigValue
            {
                typeIndex = overlapper.typeIndex,
                ValueIndex = overlapper.ValueIndex == UNDEFINED_VALUE ? this.ValueIndex : overlapper.ValueIndex
            });
        }
 public bool CheckRestriction(ConfigValue a, ConfigValue b)
 {
     return(CheckRestriction(a.typeIndex, a.ValueIndex, b.typeIndex, b.ValueIndex));
 }
 public ConfigMaskMatch GetConfigMask(ConfigValue a, ConfigValue b)
 {
     return(restrictions.Find(r => r.CheckMatch(a, b)));
 }
 public int GetIndexRestrictionViolated(ConfigValue a, ConfigValue b)
 {
     return(GetIndexRestrictionViolated(a.typeIndex, a.ValueIndex, b.typeIndex, b.ValueIndex));
 }
Example #5
0
 /// <summary>
 /// Two ConfigValues are Same if they have same type and same value.
 /// </summary>
 /// <param name="otherTypeIndex"></param>
 /// <param name="otherValueindex"></param>
 /// <returns></returns>
 public bool Same(ConfigValue other)
 {
     return(Same(other.typeIndex, other.ValueIndex));
 }
Example #6
0
 /// <summary>
 /// Two ConfigValues are Similar if (with same type index) they have same value OR at least one of the values is UNDEFINED_VALUE.
 /// </summary>
 /// <param name="otherTypeIndex"></param>
 /// <param name="otherValueIndex"></param>
 /// <returns></returns>
 public bool Similar(ConfigValue other)
 {
     return(Similar(other.typeIndex, other.ValueIndex));
 }