Skip to content

Commit

Permalink
add constant for an empty hand
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonifatius94 committed Nov 16, 2023
1 parent e37f9f1 commit 8cf6bac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Schafkopf.Lib.Tests/HandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ namespace Schafkopf.Lib.Test;

public class HandPropertiesTest
{
[Fact]
public void Test_EmptyHandIsEmpty()
{
var hand = Hand.EMPTY;
hand.Should().HaveCount(0);
}

[Fact]
public void Test_CanRetrieveCardOfAnyTypeAndColor()
{
Expand Down
2 changes: 2 additions & 0 deletions Schafkopf.Lib/Hand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public unsafe struct Hand : IEnumerable<Card>
private static readonly ulong[] EXISTING_SINGLE;
private static readonly ulong[] TRUMPF_SINGLE;

public static readonly Hand EMPTY = new Hand(0);

static Hand()
{
EXISTING_SINGLE = new ulong[8];
Expand Down

0 comments on commit 8cf6bac

Please sign in to comment.