File: gnubg-types.h

package info (click to toggle)
gnubg 0.90%2B20091206-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 23,660 kB
  • ctags: 7,575
  • sloc: ansic: 92,588; xml: 13,661; sh: 1,058; makefile: 473; python: 429; yacc: 295; sql: 237; lex: 221; php: 103; cs: 81; awk: 25
file content (64 lines) | stat: -rw-r--r-- 1,838 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * gnubg-types.h
 *
 * by Christian Anthon
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 3 or later of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: gnubg-types.h,v 1.5 2009/03/21 21:46:33 c_anthon Exp $
 */

#ifndef _GNUBG_TYPES_H_
#define _GNUBG_TYPES_H_

typedef unsigned int TanBoard[2][25];
typedef const unsigned int (*ConstTanBoard)[25];

typedef enum _bgvariation {
	VARIATION_STANDARD,	/* standard backgammon */
	VARIATION_NACKGAMMON,	/* standard backgammon with nackgammon starting
				   position */
	VARIATION_HYPERGAMMON_1,	/* 1-chequer hypergammon */
	VARIATION_HYPERGAMMON_2,	/* 2-chequer hypergammon */
	VARIATION_HYPERGAMMON_3,	/* 3-chequer hypergammon */
	NUM_VARIATIONS
} bgvariation;

typedef enum _gamestate {
	GAME_NONE, GAME_PLAYING, GAME_OVER, GAME_RESIGNED, GAME_DROP
} gamestate;

typedef struct _matchstate {
	TanBoard anBoard;
	unsigned int anDice[2];	/* (0,0) for unrolled dice */
	int fTurn;		/* who makes the next decision */
	int fResigned;
	int fResignationDeclined;
	int fDoubled;
	int cGames;
	int fMove;		/* player on roll */
	int fCubeOwner;
	int fCrawford;
	int fPostCrawford;
	int nMatchTo;
	int anScore[2];
	int nCube;
	unsigned int cBeavers;
	bgvariation bgv;
	int fCubeUse;
	int fJacoby;
	gamestate gs;
} matchstate;

#endif