From fac5e3de0929c3abb73da552efbda6d641136588 Mon Sep 17 00:00:00 2001 From: Mario Kilies Date: Sun, 16 Jan 2011 07:57:28 +0100 Subject: Simplified net_recv(). Refactored 'hand' from array definition to hand_t struct definition. --- src/game.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index 2583fb1..96a987c 100644 --- a/src/game.c +++ b/src/game.c @@ -1,5 +1,6 @@ #include "game.h" #include "card.h" +#include "hand.h" #include #include #include @@ -59,14 +60,14 @@ void start_game(const bool servermode, const char *addr, const uint16_t port) const uint32_t score = 10; // Example data set for hand cards window - hand h = {22, 0, 12, 85, 27, 69, 78, 0, 77, 0}; - hand_sort(h); + hand_t h = { {22, 0, 12, 85, 27, 69, 78, 0, 77, 0} }; + hand_sort(&h); // Display all windows ui_display_wnd_table_cards(ts, false, 0); ui_display_wnd_stack_points(ts, false, 0); ui_display_wnd_current_state(pnoc, num_players, 2, score); - ui_display_wnd_hand_cards(h, false, 0); + ui_display_wnd_hand_cards(&h, false, 0); // main game loop while(running) @@ -80,7 +81,7 @@ void start_game(const bool servermode, const char *addr, const uint16_t port) case STATE_WAIT_CARDS: // wait on client until host has dealt cards break; case STATE_SELECTCARD: // player has to select own card, if done, set state to STATE_WAIT_OPPONENTCARDS - ui_choose_card(h); + ui_choose_card(&h); running = false; break; case STATE_WAIT_OPPONENTCARDS: // wait until all opponents have selected their open card. Then check if we have the lowest open card. If so, set state to STATE_SELECTSTACK, otherwise to STATE_WAIT_OPPONENTSTACK -- cgit v1.2.3