public bool Equals(Card?other) { return(other != null && DeckNo.Equals(other.DeckNo) && Suit.Equals(other.Suit) && Rank.Equals(other.Rank)); }
public Card(DeckNo deckNo, Suit suit, Rank rank) { if (!Enum.IsDefined(typeof(DeckNo), deckNo)) { throw new ArgumentOutOfRangeException(nameof(deckNo)); } if (!Enum.IsDefined(typeof(Suit), suit)) { throw new ArgumentOutOfRangeException(nameof(suit)); } if (!Enum.IsDefined(typeof(Rank), rank)) { throw new ArgumentOutOfRangeException(nameof(rank)); } DeckNo = deckNo; Suit = suit; Rank = rank; }