diff options
| author | Michał Klichowicz <emkael@tlen.pl> | 2026-09-18 10:12:56 +0200 |
|---|---|---|
| committer | Michał Klichowicz <emkael@tlen.pl> | 2026-09-18 10:12:56 +0200 |
| commit | 71f005f4e939d71d64f00c66748963f8895434d0 (patch) | |
| tree | 4928f6a8812ef4ca7bf6d71c5c1c28a71cbcd7e5 /src/PBNBoard.cs | |
| parent | 52f67e299ac5c850b286f7d512b3c536192e2219 (diff) | |
Moving card count check to the reported non-fatal errors
Diffstat (limited to 'src/PBNBoard.cs')
| -rw-r--r-- | src/PBNBoard.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/PBNBoard.cs b/src/PBNBoard.cs index fb36f00..15acbe0 100644 --- a/src/PBNBoard.cs +++ b/src/PBNBoard.cs @@ -463,10 +463,13 @@ namespace BCDD List<String> errors = new List<string>();
BoardLayout layout = new BoardLayout(this.GetLayout());
+
foreach (KeyValuePair<String, Dictionary<String, List<String>>> hand in layout.Hands)
{
+ int handCount = 0;
foreach (KeyValuePair<String, List<String>> suit in hand.Value)
{
+ handCount += suit.Value.Count;
foreach (String card in suit.Value)
{
if (cards.Contains(card.ToUpper()))
@@ -479,6 +482,13 @@ namespace BCDD }
}
}
+ if (handCount != 13)
+ {
+ errors.Add(String.Format("Hand in {0} does not contain 13 cards: {1}",
+ hand.Key,
+ String.Join(".", hand.Value.Select(suit => String.Join("", suit.Value.ToArray())).ToArray())
+ ));
+ }
}
foreach (KeyValuePair<String, List<String>> card in deck)
|
