summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorMario Kilies <MarioKilies@GMX.net>2011-01-16 07:57:28 +0100
committerMario Kilies <MarioKilies@GMX.net>2011-01-16 07:57:28 +0100
commitfac5e3de0929c3abb73da552efbda6d641136588 (patch)
tree2d1c20909525e657237389a9825e3c3a73dad726 /src/game.c
parent08a3c0b9979857e708865d2756ba057bb1c664ee (diff)
Simplified net_recv(). Refactored 'hand' from array definition to hand_t struct definition.
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c9
1 files changed, 5 insertions, 4 deletions
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 <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