Exemple #1
0
        public int CompareTo([AllowNull] ICard other)
        {
            CardUtilities.CountComparison();

            if (other == null)
            {
                return(1);
            }

            if (Value > other.Value)
            {
                return(1);
            }
            else if (Value < other.Value)
            {
                return(-1);
            }
            else
            {
                if (Suit > other.Suit)
                {
                    return(1);
                }
                else if (Suit < other.Suit)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }
        }
Exemple #2
0
 public int CompareTo([AllowNull] ICard other)
 {
     CardUtilities.CountComparison();
     return(_value.CompareTo(GetUnderlyingValue(other) ?? 0));
 }