1 /*
2  * src/client/board.h, part of Complete Goban (game program)
3  * Copyright (C) 1995-1996 William Shubert.
4  * See "configure.h.in" for more copyright information.
5  */
6 
7 
8 #ifndef  _CLIENT_BOARD_H_
9 
10 #ifndef  _GOBOARD_H_
11 #include "../goBoard.h"
12 #endif
13 #ifndef  _CLIENT_DATA_H_
14 #include "data.h"
15 #endif
16 #ifndef  _GOGAME_H_
17 #include "../goGame.h"
18 #endif
19 #ifndef  _GOBAN_H_
20 #include "../goban.h"
21 #endif
22 #ifndef  _SGF_H_
23 #include "../sgf.h"
24 #endif
25 #ifdef  _CLIENT_BOARD_H_
26         LEVELIZATION ERROR
27 #endif
28 #define  _CLIENT_BOARD_H_  1
29 
30 
31 /**********************************************************************
32  * Data Types
33  **********************************************************************/
34 typedef struct CliBoard_struct  {
35   CliData  *data;
36   Cgoban  *cg;
37   Sgf  *sgf;
38   SgfElem  *gameEnd;
39   int  gameNum, lastMoveRead;
40   bool  gameEnded, onTrack;
41   GoGame  *game;
42   Goban  *goban;
43   But  *shiftKeytrap, *ctrlKeytrap;
44   void  (*destroy)(struct CliBoard_struct *cli, void *packet);
45   void  *packet;
46   GoTime  timer;
47   Str  wName, bName;
48   bool  moveWhite, moveBlack;
49   Str  result;
50 
51   MAGIC_STRUCT
52 } CliBoard;
53 
54 
55 /**********************************************************************
56  * Functions
57  **********************************************************************/
58 extern CliBoard  *cliBoard_create(CliData *data, int gameNum,
59 				  const Str *wName, const Str *wRank,
60 				  const Str *bName, const Str *bRank,
61 				  int size, int handicap, float komi,
62 				  int mainTime, int byTime,
63 				  void (*destroy)(CliBoard *cli,
64 						  void *packet),
65 				  void *packet);
66 extern void  cliBoard_destroy(CliBoard *board, bool propagate);
67 extern Bool  cliBoard_gotMove(CliBoard *board, const char *locStr,
68 			      GoStone color, int moveNum);
69 #define  cliBoard_addKibitz(cli, kib)  goban_catComments((cli)->goban, (kib))
70 GobanOut  cliBoard_gridPressed(void *packet, int loc, bool forcePress);
71 GobanOut  cliBoard_passPressed(void *packet);
72 extern void  cliBoard_update(CliBoard *cli);
73 
74 
75 #endif  /* _CLIENT_BOARD_H_ */
76