diff options
| author | Mario Kilies <MarioKilies@GMX.net> | 2011-01-25 13:14:17 +0100 |
|---|---|---|
| committer | Mario Kilies <MarioKilies@GMX.net> | 2011-01-25 13:14:17 +0100 |
| commit | 52f95177eb8050f073a3d65413feb16cfce93baa (patch) | |
| tree | f94b78be6d4b09fe3ee7d93d4b40c80387a80f33 /src/player.h | |
| parent | 3fc586325f8fc8fb4f1990bf87ad4c37e722f381 (diff) | |
Removed awkward pnoc_t and refactored its contents to the new player_list_entry_t.
Diffstat (limited to 'src/player.h')
| -rw-r--r-- | src/player.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/player.h b/src/player.h index f162cfa..41e928b 100644 --- a/src/player.h +++ b/src/player.h @@ -2,16 +2,27 @@ #define OXEN_PLAYER_H #define MAX_PLAYERS 10 +#define MAX_PLAYER_NAME_LENGTH 10 #include <stdint.h> -#include "pnoc.h" +#include "card.h" + +typedef uint8_t player_id_t; + +typedef struct +{ + player_id_t player_id; + char player_name[MAX_PLAYER_NAME_LENGTH + 1]; + card open_card; +} player_list_entry_t; typedef struct { uint8_t count; - pnoc_t players[MAX_PLAYERS]; -} player_list; + player_list_entry_t players[MAX_PLAYERS]; +} player_list_t; -pnoc_t* get_pnoc_from_playerid(player_list* pl, const uint8_t pid); +player_list_entry_t *get_player_list_entry_by_player_id(player_list_t *pl, const player_id_t pid); +void player_list_sort_by_open_card(player_list_t *pl, const uint8_t num_entries); #endif // OXEN_PLAYER_H |
