83 typedef uint16_t CwChessboardCode;
111 explicit Code(CwChessboardCode code) {
M_bits = CwChessboardCode_to_Code[code].M_bits; }
198 operator CwChessboardCode(
void)
const {
return Code_to_CwChessboardCode[
M_bits]; }
203 static CwChessboardCode Code_to_CwChessboardCode[16];
204 static CodeData CwChessboardCode_to_Code[14];
CodeData const black_pawn
A constant representing a black pawn.
The POD base type of class Code.
A namespace for all chess related objects that are not related to the GUI.
This file contains the declaration of class Type.
bool is(Color const& color) const
Return TRUE if the color is equal.
uint8_t operator()(void) const
Return the unlaying integral value.
CodeData const white_queen
A constant representing a white queen.
bool is_nothing(void) const
Returns TRUE if the code represents& #39;nothing'.
This file contains the declaration of class Direction.
Code(CodeData code)
Construct a Code object from a constant.
Code(Color const& color, Type const& type)
Construct a Code object with color color and type type.
CodeData const black_queen
A constant representing a black queen;.
Code(void)
Construct a Code object initialized as& #39;nothing'.
Code & operator=(Code const& code)
Assign from another Code.
Code & operator=(Color const& color)
Change the color to color.
uint8_t const bishop_bits
The underlaying integral value of type& #39;bishop'.
bool moves_along(Direction const& direction)
Return TRUE if this piece moves along direction.
uint8_t M_bits
0TKNQ000, T=can move two squares, K=can take king side, N=is not blocked, Q=can take queen side...
CodeData const black_rook
A constant representing a black rook;.
BitBoardData const c1
The square c1.
bool is_a_slider(void) const
Returns TRUE if the type is a bishop, rook or queen.
Code & operator=(Type const& type)
Change the type to type. Type may not be nothing (use clear() instead).
uint8_t M_bits
00000STT, where STT is the type. If S == 1 then the piece is a slider.
bool has_opposite_color_of(Code const& code)
Return TRUE if the colors are different.
Code(CwChessboardCode code)
Explicit conversion from CwChessboardCode to Code.
CodeData const white_rook
A constant representing a white rook.
The POD base type of class Color.
bool is(ColorData color) const
Return TRUE if the color is equal.
void clear(void)
Set the type to nothing.
bool is_a(Type const& type) const
Returns TRUE if the type is equal.
uint8_t const white_bits
The underlaying integral value of color& #39;white'.
bool is_a(TypeData type) const
Returns TRUE if the type is equal.
uint8_t const king_bits
The underlaying integral value of type& #39;king'.
CodeData const black_bishop
A constant representing a black bishop;.
bool is_a_rookmover(void) const
Returns TRUE if the type is a rook or queen.
A chess piece type including color.
This file contains the declaration of class Color.
Code(Code const& code)
Copy-constructor.
Code & operator=(CodeData code)
Assign from a constant.
uint8_t const black_bits
The underlaying integral value of color& #39;black'.
bool is_a_bishopmover(void) const
Returns TRUE if the type is a bishop or queen.
CodeData const black_king
A constant representing a black king;.
Type type(void) const
Return the Type of this Code.
uint8_t const color_mask
A mask for the bits used for the color of a piece.
CodeData const white_pawn
A constant representing a white pawn.
CodeData const black_knight
A constant representing a black knight;.
A color (black or white).
CodeData const white_king
A constant representing a white king.
uint8_t const type_mask
A mask for the bits used for the type of a piece.
uint8_t M_bits
0000C000, where C=0 means black and C=1 means white.
uint8_t const knight_bits
The underlaying integral value of type& #39;knight'.
void toggle_color(void)
Toggle the color. May not be used on type& #39;nothing'.
The POD base type of class Type.
Color color(void) const
Return the Color of this Code.
uint8_t const queen_bits
The underlaying integral value of type& #39;queen'.
CodeData const white_bishop
A constant representing a white bishop.
BitBoardData const c2
The square c2.
CodeData const white_knight
A constant representing a white knight.
uint8_t M_bits
0000CTTT, where C is the color and TTT the type.
uint8_t const pawn_bits
The underlaying integral value of type& #39;pawn'.
uint8_t const rook_bits
The underlaying integral value of type& #39;rook'.