29 |
29 |
30 #ifndef GAME_H |
30 #ifndef GAME_H |
31 #define GAME_H |
31 #define GAME_H |
32 |
32 |
33 #include "terminal-chess.h" |
33 #include "terminal-chess.h" |
|
34 #include <stdint.h> |
34 |
35 |
35 #ifdef __cplusplus |
36 #ifdef __cplusplus |
36 extern "C" { |
37 extern "C" { |
37 #endif |
38 #endif |
|
39 |
|
40 #define PIECE_MASK 0x0F |
|
41 #define COLOR_MASK 0xF0 |
|
42 |
|
43 #define WHITE 0x10 |
|
44 #define BLACK 0x20 |
|
45 |
|
46 #define PAWN 0x01 |
|
47 #define ROOK 0x02 |
|
48 #define KNIGHT 0x03 |
|
49 #define BISHOP 0x04 |
|
50 #define QUEEN 0x05 |
|
51 #define KING 0x06 |
|
52 |
|
53 #define WPAWN (WHITE|PAWN) |
|
54 #define WROOK (WHITE|ROOK) |
|
55 #define WKNIGHT (WHITE|KNIGHT) |
|
56 #define WBISHOP (WHITE|BISHOP) |
|
57 #define WQUEEN (WHITE|QUEEN) |
|
58 #define WKING (WHITE|KING) |
|
59 #define BPAWN (BLACK|PAWN) |
|
60 #define BROOK (BLACK|ROOK) |
|
61 #define BKNIGHT (BLACK|KNIGHT) |
|
62 #define BBISHOP (BLACK|BISHOP) |
|
63 #define BQUEEN (BLACK|QUEEN) |
|
64 #define BKING (BLACK|KING) |
|
65 |
|
66 typedef uint8_t Board[8][8]; |
38 |
67 |
39 void game_start(Settings *settings, int opponent); |
68 void game_start(Settings *settings, int opponent); |
40 |
69 |
41 #ifdef __cplusplus |
70 #ifdef __cplusplus |
42 } |
71 } |