Files
basic-computer-games/71_Poker/csharp/Cards/Card.cs
2022-06-18 22:15:05 +10:00

12 lines
352 B
C#

namespace Poker.Cards;
internal record struct Card (Rank Rank, Suit Suit)
{
public override string ToString() => $"{Rank} of {Suit}";
public static bool operator <(Card x, Card y) => x.Rank < y.Rank;
public static bool operator >(Card x, Card y) => x.Rank > y.Rank;
public static int operator -(Card x, Card y) => x.Rank - y.Rank;
}