19 |
|
|
20 |
#include <poll.h> |
#include <poll.h> |
21 |
#include <glib.h> |
#include <glib.h> |
|
#include "tarot.h" |
|
22 |
|
|
23 |
typedef struct |
typedef |
24 |
|
gboolean (*rule_check_f) (void * game, int prev_winner, int c, int p, GError ** error); |
25 |
|
typedef gint (*rule_compute_winner_f) (void * g, gint prev_winner); |
26 |
|
|
27 |
|
typedef struct game_t |
28 |
{ |
{ |
29 |
char *name; |
char *name; |
30 |
char *type; |
char *type; |
32 |
int nb_players_max; |
int nb_players_max; |
33 |
int nb_players; |
int nb_players; |
34 |
int turn; |
int turn; |
35 |
int game_turn; /* const for one game; increments each game */ |
int turn_nb; |
36 |
|
int turn_starter; |
37 |
|
int game_turn; /* const for one game; increments each game */ |
38 |
GArray *players; |
GArray *players; |
39 |
GArray *watchers; |
GArray *watchers; |
40 |
rules_t *rules; |
void *rules; |
41 |
|
rule_check_f rule_check; |
42 |
|
rule_compute_winner_f rule_compute_winner; |
43 |
} game_t; |
} game_t; |
44 |
|
|
45 |
typedef struct player_t |
typedef struct player_t |
63 |
|
|
64 |
extern config_t *config; |
extern config_t *config; |
65 |
|
|
66 |
|
#define RULES(r) ((rules_t*)(r)) |
67 |
|
|
68 |
|
|
69 |
#endif |
#endif |