From c7181ee943069bde7f5d468d11ee63c3a535980d Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Tue, 25 Jan 2011 16:12:34 +0100 Subject: 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 --- src/hand.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/hand.c') 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; icards[i] != 0) + count++; + + return count; +} + -- cgit v1.2.3