diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2011-01-25 16:12:34 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2011-01-25 16:12:34 +0100 |
| commit | c7181ee943069bde7f5d468d11ee63c3a535980d (patch) | |
| tree | 56d8dd1128faa734fd0c63f78e1963d9640128d2 /src/hand.c | |
| parent | 72504b3fa304c1bf0731fec80d3b85c5481ee0a2 (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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; +} + |
