Files
basic-computer-games/71_Poker/csharp/Card.cs
2022-06-03 08:42:21 +10:00

12 lines
346 B
C#

namespace Poker;
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;
}