mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-08 19:33:31 -08:00
Reorganise classes
This commit is contained in:
11
71_Poker/csharp/Cards/Card.cs
Normal file
11
71_Poker/csharp/Cards/Card.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user