2 Copyright (c) 1993 Richard V. Nash.
3 Copyright (c) 2000 Dan Papasian
4 Copyright (C) Andrew Tridgell 2002
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 extern const char *bstr[];
25 extern const char *rstr[];
27 #define GAMEFILE_VERSION 5
28 #define MAX_GLINE_SIZE 1024
35 GENSTRUCT enum gamestatus {GAME_EMPTY, GAME_NEW, GAME_ACTIVE, GAME_EXAMINE, GAME_SETUP};
37 /* Do not change the order of these - DAV */
38 GENSTRUCT enum gametype {TYPE_UNTIMED, TYPE_BLITZ, TYPE_STAND, TYPE_NONSTANDARD,
39 TYPE_WILD, TYPE_LIGHT, TYPE_BUGHOUSE, TYPE_GOTHIC, TYPE_KNIGHTMATE, TYPE_CAPABLANCA};
41 #define NUM_GAMETYPES 10
43 /* OK, DAV, I'll try it another way. -- hersco */
44 enum ratetype {RATE_STAND, RATE_BLITZ, RATE_WILD, RATE_LIGHT, RATE_BUGHOUSE};
45 #define NUM_RATEDTYPE 5
47 #define FLAG_CHECKING -1
52 GENSTRUCT enum gameend {
72 END_BARE // [HGM] bare king
77 char WhiteName[MAX_LOGIN_NAME];
79 char BlackName[MAX_LOGIN_NAME];
90 GENSTRUCT struct game {
91 /* Not saved in game file */
97 enum gamestatus status;
100 struct move_t *examMoveList; _LEN(examMoveListSize) /* extra movelist for examine */
102 unsigned startTime; /* The relative time the game started */
103 unsigned lastMoveTime; /* Last time a move was made */
104 unsigned lastDecTime; /* Last time a players clock was decremented */
106 int wTimeWhenReceivedMove;
108 int bTimeWhenReceivedMove;
115 /* this is a dummy variable used to tell which bits are saved in the structure */
116 unsigned not_saved_marker;
118 /* Saved in the game file */
121 int wInitTime, wIncrement;
122 int bInitTime, bIncrement;
124 unsigned flag_check_time;
131 int passes; /* For simul's */
133 int moveListSize; /* Total allocated in *moveList */
134 struct move_t *moveList; _LEN(moveListSize) /* primary movelist */
135 char FENstartPos[74]; _NULLTERM /* Save the starting position. */
136 struct game_state_t game_state;
138 char white_name[MAX_LOGIN_NAME]; _NULLTERM /* to hold the playername even after he disconnects */
139 char black_name[MAX_LOGIN_NAME]; _NULLTERM
142 char variant[80]; // [HGM] arbitrary variant name for sending to interface, derived from load-directory name
145 extern const char *TypeStrings[NUM_GAMETYPES];
146 extern const char *TypeChars[NUM_GAMETYPES];