summaryrefslogtreecommitdiff
path: root/src/hand.c
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2011-01-25 16:12:34 +0100
committerReiner Herrmann <reiner@reiner-h.de>2011-01-25 16:12:34 +0100
commitc7181ee943069bde7f5d468d11ee63c3a535980d (patch)
tree56d8dd1128faa734fd0c63f78e1963d9640128d2 /src/hand.c
parent72504b3fa304c1bf0731fec80d3b85c5481ee0a2 (diff)
finished implementing play_cards function for client/server; added new message type next_action which indicates whether the game is finished or the server will deal new cards
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;
+}
+