From 49a31a58e1b77ed0d88c0271247d4f707cf8b641 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Tue, 25 Jan 2011 14:36:47 +0100 Subject: implement part of state_client_play_cards(); added new message type: hello reply from server which notifies clients of their player-ids --- src/card_stack.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/card_stack.c') diff --git a/src/card_stack.c b/src/card_stack.c index 206a9d8..13b14dd 100644 --- a/src/card_stack.c +++ b/src/card_stack.c @@ -16,3 +16,28 @@ uint32_t card_stack_get_points(const card_stack_t *cs) return points; } + +const card card_stack_upper_card(const card_stack_t *cs) +{ + assert(cs != NULL); + + for(int i=0; icards[MAX_CARD_STACK_SIZE-1-i]; + if(cur != 0) + return cur; + } + + return 0; +} + +void card_stack_clear(card_stack_t *cs, const card new_card) +{ + assert(cs != NULL); + + for(int i=0; icards[i] = 0; + + cs->cards[0] = new_card; +} + -- cgit v1.2.3