Back to index

gcompris  8.2.2
chess_makros.h
Go to the documentation of this file.
00001 /* 
00002  * Copyright (C) 1999 Robert Wilhelm
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00017  */
00018 
00019 #ifndef _MAKROS_H_
00020 #define _MAKROS_H_
00021 
00022 #include <glib.h>
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #pragma }
00027 #endif /* __cplusplus */
00028 
00029 /* Types */
00030 typedef gushort Square;
00031 typedef gchar   Piece;
00032 
00033 /* Various empty defines */
00034 #define NONE         0
00035 
00036 /* Generated movelist */
00037 #define AB_ZUGL             512    /*  Length of list generated moves */
00038 #define AB_ZUG_S     256    /*  Beginning of generated capture moves*/
00039 
00040 /* Colours */
00041 #define WHITE        1      /*  White to Move                  */
00042 #define BLACK        129    /*  Black to move                  */
00043 
00044 /* Notation types */
00045 #define       SAN           0      /*  Standard algebraic notation           */
00046 #define       COORD         1      /*  Coordinate notation                   */
00047 
00048 /* Game results */
00049 #define       GAME_NONE     0      /*  No game                         */
00050 #define       GAME_PAUSED   1      /*  Game is paused                 */
00051 #define       GAME_PROGRESS 2      /*  Game is in progress                   */
00052 #define       GAME_ABORTED  3      /*  Game was aborted               */
00053 #define       GAME_WHITE    4      /*  White won the game                    */
00054 #define       GAME_BLACK    5      /*  Black won the game                    */
00055 #define       GAME_DRAW     6      /*  Draw                            */
00056 
00057 /* Board window modes */
00058 #define       COMPUTER_BLACK       1
00059 #define       COMPUTER_WHITE       2
00060 #define       AUTOPLAY      3
00061 #define       ANALYSE              4
00062 #define       HUMANS        5
00063 
00064 #define  OL            9     /********************************************/
00065 #define  OM           10     /*                                          */
00066 #define  OR           11     /*            OL |  OM  | OR                */
00067 #define  LI           -1     /*           ----+------+----               */
00068 #define  RE            1     /*            LI | FELD | RE                */
00069 #define  UL          -11     /*           ----+------+----               */
00070 #define  UM          -10     /*            UL |  UM  | UR                */
00071 #define  UR           -9     /********************************************/
00072 
00073 /*************************************************************************/
00074 /*                         Figuren      Pieces                           */
00075 /*************************************************************************/
00076 /*                                                                       */
00077 /*      weiss   white  32 + x      x = 1  Bauer     Pawn                 */
00078 /*      schwarz black  64 + x          2  Springer  Knight               */
00079 /*      leer    empty  0               3  Laeufer   Bishop               */
00080 /*      rand    border 16              4  Turm      Rook                 */
00081 /*                                     5  Dame      Queen                */
00082 /*                                     6  Koenig    King                 */
00083 /*                                                                       */
00084 /*************************************************************************/
00085 
00086 #define WP           33      /*  white pawn   */
00087 #define WN           34      /*  white knight */
00088 #define WB           35      /*  white bishop */
00089 #define WR           36      /*  white rook   */
00090 #define WQ           37      /*  white queen  */
00091 #define WK           38      /*  white king   */
00092 #define BP           65      /*  black pawn   */
00093 #define BN           66      /*  black knight */
00094 #define BB           67      /*  black bishop */
00095 #define BR           68      /*  black rook   */
00096 #define BQ           69      /*  black queen  */
00097 #define BK           70      /*  black king        */
00098 #define EMPTY     0              /*  empty         */
00099 #define BORDER    16             /*  border (illegal) */
00100 
00101 #define WPIECE(c) ((c) & 32)   /* white piece? */
00102 #define BPIECE(c) ((c) & 64)   /* black piece? */
00103 
00104 /****************************************************************/
00105 /*                      Squares                                 */
00106 /****************************************************************/
00107 
00108 #define A1 21
00109 #define B1 22
00110 #define C1 23
00111 #define D1 24
00112 #define E1 25
00113 #define F1 26
00114 #define G1 27
00115 #define H1 28
00116 #define A2 31
00117 #define B2 32
00118 #define C2 33
00119 #define D2 34
00120 #define E2 35
00121 #define F2 36
00122 #define G2 37
00123 #define H2 38
00124 #define A3 41
00125 #define B3 42
00126 #define C3 43
00127 #define D3 44
00128 #define E3 45
00129 #define F3 46
00130 #define G3 47
00131 #define H3 48
00132 #define A4 51
00133 #define B4 52
00134 #define C4 53
00135 #define D4 54
00136 #define E4 55
00137 #define F4 56
00138 #define G4 57
00139 #define H4 58
00140 #define A5 61
00141 #define B5 62
00142 #define C5 63
00143 #define D5 64
00144 #define E5 65
00145 #define F5 66
00146 #define G5 67
00147 #define H5 68
00148 #define A6 71
00149 #define B6 72
00150 #define C6 73
00151 #define D6 74
00152 #define E6 75
00153 #define F6 76
00154 #define G6 77
00155 #define H6 78
00156 #define A7 81
00157 #define B7 82
00158 #define C7 83
00159 #define D7 84
00160 #define E7 85
00161 #define F7 86
00162 #define G7 87
00163 #define H7 88
00164 #define A8 91
00165 #define B8 92
00166 #define C8 93
00167 #define D8 94
00168 #define E8 95
00169 #define F8 96
00170 #define G8 97
00171 #define H8 98
00172 
00173 #ifdef __cplusplus
00174 }
00175 #endif /* __cplusplus */
00176 
00177 #endif /* _MAKROS_H_ */
00178