diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game.c | 5 | ||||
| -rw-r--r-- | src/game.h | 10 |
2 files changed, 3 insertions, 12 deletions
@@ -14,6 +14,7 @@ #include "net/comm.h" #include "net/client.h" #include "net/server.h" +#include "game_states.h" static void init_mainstack(card *stack, const uint32_t size) { @@ -62,7 +63,7 @@ static const uint8_t num_cards_in_stack(const card *stack, const uint32_t size) static void main_loop_client(int sock) { bool running = true; - gamestate state = STATE_CLIENT_WAIT_FOR_HAND_CARDS; + game_state_t state = STATE_CLIENT_WAIT_FOR_HAND_CARDS; uint8_t round = 1; data_store *data = datamodel(); uint8_t open_card_idx; @@ -176,7 +177,7 @@ static void main_loop_server(socket_list_t* client_socks) uint8_t round = 1; int cards = MAX_CARD - MIN_CARD + 1; card mainstack[cards]; - gamestate state = STATE_SERVER_DEAL_HAND_CARDS; + game_state_t state = STATE_SERVER_DEAL_HAND_CARDS; data_store *data = datamodel(); @@ -7,16 +7,6 @@ #define MIN_CARD 1 #define MAX_CARD 104 -typedef enum { - STATE_CLIENT_WAIT_FOR_HAND_CARDS, - STATE_CLIENT_SELECT_OPEN_CARD, - STATE_CLIENT_WAIT_FOR_OPEN_CARDS, - STATE_CLIENT_PLAY_CARDS, - STATE_SERVER_DEAL_HAND_CARDS, - STATE_SERVER_WAIT_FOR_OPEN_CARDS, - STATE_SERVER_PLAY_CARDS -} gamestate; - void start_game(const bool servermode, const char* addr, const char* port); #endif // OXEN_GAME_H |
