33 void CastleFlags::piece_moved_from(
Piece const& piece, Index
const& from)
35 switch (piece.code()())
39 M_bits |= black_rook_queen_side_moved;
41 M_bits |= black_rook_king_side_moved;
44 M_bits |= black_king_moved;
48 M_bits |= white_rook_queen_side_moved;
50 M_bits |= white_rook_king_side_moved;
53 M_bits |= white_king_moved;
63 return M_bits & white_rook_queen_side_moved;
65 return M_bits & white_king_moved;
67 return M_bits & white_rook_king_side_moved;
69 return M_bits & black_rook_queen_side_moved;
71 return M_bits & black_king_moved;
73 return M_bits & black_rook_king_side_moved;
A namespace for all chess related objects that are not related to the GUI.
IndexData const ia1
A constant representing the index to square a1.
IndexData const ih1
A constant representing the index to square h1.
This file contains the declaration of class CastleFlags.
bool has_moved(Code const& code, Index const& index)
Return TRUE if code at index is marked as having moved.
IndexData const ih8
A constant representing the index to square h8.
IndexData const ia8
A constant representing the index to square a8.
CodeData const black_rook
A constant representing a black rook;.
The index of a chess square.
CodeData const white_rook
A constant representing a white rook.
uint8_t const white_bits
The underlaying integral value of color& #39;white'.
uint8_t const king_bits
The underlaying integral value of type& #39;king'.
A chess piece type including color.
uint8_t const black_bits
The underlaying integral value of color& #39;black'.
CodeData const black_king
A constant representing a black king;.
CodeData const white_king
A constant representing a white king.
IndexData const ie8
A constant representing the index to square e8.
IndexData const ie1
A constant representing the index to square e1.
uint8_t const rook_bits
The underlaying integral value of type& #39;rook'.