1 /* 2 * gnubg-types.h 3 * 4 * by Christian Anthon 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of version 3 or later of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * $Id: gnubg-types.h,v 1.9 2013/06/16 02:16:23 mdpetch Exp $ 20 */ 21 22 #ifndef GNUBG_TYPES_H 23 #define GNUBG_TYPES_H 24 25 typedef unsigned int TanBoard[2][25]; 26 typedef const unsigned int (*ConstTanBoard)[25]; 27 28 typedef enum _bgvariation { 29 VARIATION_STANDARD, /* standard backgammon */ 30 VARIATION_NACKGAMMON, /* standard backgammon with nackgammon starting 31 * position */ 32 VARIATION_HYPERGAMMON_1, /* 1-chequer hypergammon */ 33 VARIATION_HYPERGAMMON_2, /* 2-chequer hypergammon */ 34 VARIATION_HYPERGAMMON_3, /* 3-chequer hypergammon */ 35 NUM_VARIATIONS 36 } bgvariation; 37 38 typedef enum _gamestate { 39 GAME_NONE, GAME_PLAYING, GAME_OVER, GAME_RESIGNED, GAME_DROP 40 } gamestate; 41 42 typedef struct _matchstate { 43 TanBoard anBoard; 44 unsigned int anDice[2]; /* (0,0) for unrolled dice */ 45 int fTurn; /* who makes the next decision */ 46 int fResigned; 47 int fResignationDeclined; 48 int fDoubled; 49 int cGames; 50 int fMove; /* player on roll */ 51 int fCubeOwner; 52 int fCrawford; 53 int fPostCrawford; 54 int nMatchTo; 55 int anScore[2]; 56 int nCube; 57 unsigned int cBeavers; 58 bgvariation bgv; 59 int fCubeUse; 60 int fJacoby; 61 gamestate gs; 62 } matchstate; 63 64 typedef union _positionkey { 65 unsigned int data[7]; 66 } positionkey; 67 68 typedef union _oldpositionkey { 69 unsigned char auch[10]; 70 } oldpositionkey; 71 72 #endif 73