diff options
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,6 @@ #include "game.h" #include "card.h" +#include "hand.h" #include <stdlib.h> #include <stdbool.h> #include <time.h> @@ -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 |
