20 |
#include "cardgame_server.h" |
#include "cardgame_server.h" |
21 |
#include <glib.h> |
#include <glib.h> |
22 |
|
|
23 |
|
#define MT_RULE_ERROR mt_rule_error_quark() |
24 |
|
|
25 |
|
typedef enum |
26 |
|
{ |
27 |
|
MT_RULE_ERROR_CARD_IS_NOT_IN_PLAYERS_GAME, |
28 |
|
MT_RULE_ERROR_PLAYER_CAN_PLAY_COLOR, |
29 |
|
MT_RULE_ERROR_PLAYER_CAN_PLAY_TRUMP, |
30 |
|
MT_RULE_ERROR_UNKNOWN_CASE |
31 |
|
} |
32 |
|
|
33 |
|
mt_rule_error_e; |
34 |
|
|
35 |
typedef struct |
typedef struct |
36 |
{ |
{ |
37 |
gint card_status[78]; |
gint card_status[78]; |
42 |
* 10->14 : owner of the turn |
* 10->14 : owner of the turn |
43 |
*/ |
*/ |
44 |
|
|
45 |
|
gint board[5]; |
46 |
gint chien[6]; |
gint chien[6]; |
47 |
gint taker_score; |
gint taker_score; |
48 |
libmt_bid_e bid; |
libmt_bid_e bid; |
49 |
libmt_bid_e bids[4]; |
libmt_bid_e bids[4]; |
|
gint turn; |
|
50 |
gint players_order[4]; |
gint players_order[4]; |
51 |
gint preneur; |
gint preneur; |
52 |
gboolean was_1trump_in_last_turn; |
gboolean was_1trump_in_last_turn; |
53 |
} rules_t; |
} rules_t; |
54 |
|
|
55 |
|
gboolean rule_check (void *game, int prev_winner, int c, int p, |
56 |
|
GError ** error); |
57 |
|
gint rule_compute_winner (void *g, gint prev_winner); |
58 |
|
|
59 |
|
|
60 |
#endif |
#endif |