Exemplo n.º 1
0
        internal bool IsStrongerThan(TriggerCandidate that)
        {
            if (this == that)
            {
                return(false);
            }

            var hasStrictlyStrongerTerm = false;

            foreach (var t in Terms)
            {
                var comparison = that.Terms.Select(t.CompareTo).Max();

                // All terms of `this` must be at least as strong as a term of `that`
                if (comparison == TriggerTerm.TermComparison.NotStronger)
                {
                    return(false);
                }

                // Did we find a strictly stronger term?
                hasStrictlyStrongerTerm = hasStrictlyStrongerTerm || comparison == TriggerTerm.TermComparison.Stronger;
            }

            return(hasStrictlyStrongerTerm);
        }
Exemplo n.º 2
0
 public TriggerCandidate(TriggerCandidate candidate)
 {
     this.Terms = candidate.Terms;
 }
Exemplo n.º 3
0
 private static bool SameTriggerCandidate(TriggerCandidate arg1, TriggerCandidate arg2)
 {
     return(TriggerUtils.SameLists(arg1.Terms, arg2.Terms, TriggerTerm.Eq));
 }