public int CompareTo(object obj) { if (obj.GetType() != this.GetType()) { throw new ArgumentException("obj is not a CardSize."); } CardSize objCardSize = (CardSize)obj; return(this.Size.CompareTo(objCardSize.Size)); }
public override bool Equals(object obj) { if (this.GetType() != obj.GetType()) { return(false); } CardSize objCardSize = (CardSize)obj; return(Size.Equals(objCardSize.Size)); }