Exemplo n.º 1
0
 protected MatchEnum(MatchEnum copy)
     : base(copy)
 {
     Ordinal  = copy.Ordinal;
     Ordinal2 = copy.Ordinal2;
     Values   = copy.Values;
 }
Exemplo n.º 2
0
        public bool Subsets(Match match)
        {
            if (Priority != match.Priority)
            {
                return(false);
            }

            MatchEnum that = match as MatchEnum;

            return(Ordinal >= that.Ordinal && Ordinal2 <= that.Ordinal2);
        }
Exemplo n.º 3
0
        // Overriden due to more restrictive conditions.
        public override bool CanMerge(Match match)
        {
            if (!base.CanMerge(match))
            {
                return(false);
            }

            MatchEnum that = match as MatchEnum;

            // This match subsets, is subsetted by, or complements match.
            return(Subsets(that) || that.Subsets(this) || Complements(that));
        }
Exemplo n.º 4
0
        public bool Complements(Match match)
        {
            // The different priorities cannot complement each other (e.g. "Quality" cannot complement "ItemLevel" and vice versa).
            if (Priority != match.Priority)
            {
                return(false);
            }

            MatchEnum that = match as MatchEnum;

            // Complements from left or right.
            // XXX: Don't have to take operator into account at all, due to conversion of all operators into Between ranges in constructor.
            return(Ordinal2 + 1 == that.Ordinal || Ordinal == that.Ordinal2 + 1);
        }
Exemplo n.º 5
0
        public void Merge(Match match)
        {
            MatchEnum that = match as MatchEnum;

            if (Complements(that))
            {
                // Complements from left.
                if (Ordinal2 + 1 == that.Ordinal)
                {
                    Ordinal2 = that.Ordinal2;
                }
                else // Ordinal == that.Ordinal2 + 1
                {
                    Ordinal = that.Ordinal;
                }
            }
            else // If we subset the match.
            if (Subsets(that))
            {
                Ordinal  = that.Ordinal;
                Ordinal2 = that.Ordinal2;
            } // Otherwise match subsets us, nothing to do.
        }
Exemplo n.º 6
0
 protected MatchEnum(MatchEnum copy)
     : base(copy)
 {
     Op = copy.Op;
     Value = copy.Value;
 }
Exemplo n.º 7
0
 protected MatchEnum(MatchEnum copy)
     : base(copy)
 {
     Op    = copy.Op;
     Value = copy.Value;
 }