28 */ |
28 */ |
29 |
29 |
30 #ifndef GAME_H |
30 #ifndef GAME_H |
31 #define GAME_H |
31 #define GAME_H |
32 |
32 |
33 #include "chess/chess.h" |
33 #include "chess/game-info.h" |
34 #include "terminal-chess.h" |
|
35 |
34 |
36 #ifdef __cplusplus |
35 #ifdef __cplusplus |
37 extern "C" { |
36 extern "C" { |
38 #endif |
37 #endif |
39 |
38 |
|
39 typedef struct { |
|
40 GameInfo gameinfo; |
|
41 char* port; |
|
42 char* serverhost; /* NULL, if we are about to start a server */ |
|
43 char* continuepgn; |
|
44 char* analyzepgn; |
|
45 _Bool singlemachine; |
|
46 _Bool unicode; |
|
47 } Settings; |
|
48 |
|
49 #define is_server(settings) !((settings)->serverhost) |
|
50 |
40 void game_start(Settings *settings, int opponent); |
51 void game_start(Settings *settings, int opponent); |
41 void game_continue(Settings *settings, int opponent, GameState *gamestate); |
52 void game_continue(Settings *settings, int opponent, GameState *gamestate); |
42 void game_start_singlemachine(Settings *settings); |
53 void game_start_singlemachine(Settings *settings); |
|
54 |
|
55 int server_run(Settings* settings); |
|
56 int client_run(Settings* settings); |
|
57 |
|
58 void dump_moveinfo(GameState *gamestate); |
|
59 void dump_gameinfo(GameInfo *gameinfo); |
43 |
60 |
44 #ifdef __cplusplus |
61 #ifdef __cplusplus |
45 } |
62 } |
46 #endif |
63 #endif |
47 |
64 |