forked from RetroShare/RsChess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqtchess_defs.h
121 lines (98 loc) · 1.25 KB
/
qtchess_defs.h
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef _QTCHESS_DEFS_
#define _QTCHESS_DEFS_
/*
** -- System Includes --
*/
extern "C"
{
#include <stdio.h>
#include <stdlib.h>
}
/*
** -- Local Includes --
*/
enum
{
BLACK = 1,
WHITE = 2,
MY_TURN = 3,
I_AM_FIRST = 4,
THEIR_TURN = 5,
THEY_ARE_FIRST = 6,
PLAYER_TIMER = 7,
OPPONENT_TIMER = 8
};
enum
{
KING_BLACK = 100,
PAWN_BLACK,
ROOK_BLACK,
QUEEN_BLACK,
ROOK1_BLACK,
ROOK2_BLACK,
BISHOP_BLACK,
KNIGHT_BLACK
};
enum
{
KING_WHITE = 200,
PAWN_WHITE,
ROOK_WHITE,
QUEEN_WHITE,
ROOK1_WHITE,
ROOK2_WHITE,
BISHOP_WHITE,
KNIGHT_WHITE
};
enum
{
VALID = 1,
INVALID = 0,
NSQUARES = 8,
EMPTY_SQUARE = 0,
VALID_CASTLE = 2,
VALID_PAWN_2 = 3,
VALID_EN_PASSANT = 4,
OPEN_GL_DIMENSION = 700
};
struct move_s
{
int x1;
int x2;
int y1;
int y2;
int piece;
/*
** Used for castling moves.
*/
int r_x1;
int r_x2;
int r_y1;
int r_y2;
int rook;
/*
** For promotions.
*/
int promoted;
/*
** En passant.
*/
int enpassant;
/*
** Is the opponent's King threatened?
*/
int isOppKingThreat;
/*
** Pawn moved two squares?
*/
int pawn_2;
/*
** Current state of the board.
*/
int board[NSQUARES][NSQUARES];
/*
** Departure.
*/
char departure[3];
};
#endif