summaryrefslogtreecommitdiff
path: root/src/hand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hand.c')
-rw-r--r--src/hand.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hand.c b/src/hand.c
index 3853697..359ed08 100644
--- a/src/hand.c
+++ b/src/hand.c
@@ -24,3 +24,14 @@ void hand_remove_card(hand_t *h, const uint8_t card_index)
h->cards[card_index] = 0;
}
+
+const uint8_t hand_count_cards(const hand_t* h)
+{
+ uint8_t count = 0;
+ for(int i=0; i<MAX_HAND_CARDS; i++)
+ if(h->cards[i] != 0)
+ count++;
+
+ return count;
+}
+