30 #define DEBUG_ENPASSANT_EXISTS 0 32 #if DEBUG_ENPASSANT_EXISTS 69 EnPassant& operator=(
EnPassant const& en_passant) { M_bits = en_passant.M_bits;
return*
this; }
75 std::string FEN4(
void)
const;
87 #if DEBUG_ENPASSANT_EXISTS 90 IndexData result = {
static_cast<uint8_t
>(M_bits & 0x7f) };
97 #if DEBUG_ENPASSANT_EXISTS 100 IndexData result = {
static_cast<uint8_t
>((M_bits & 0x7f) ^ 8) };
107 #if DEBUG_ENPASSANT_EXISTS 110 IndexData result = {
static_cast<uint8_t
>((M_bits & 0x7f) ^ 24) };
117 #if DEBUG_ENPASSANT_EXISTS 120 return (M_bits & 0x80);
127 void pinned_set(
void)
129 #if DEBUG_ENPASSANT_EXISTS 136 void pinned_reset(
void) { M_bits& = 0x7f; }
143 #endif // ENPASSANT_H A namespace for all chess related objects that are not related to the GUI.
Index from_index(void) const
Return the index of the square that pawn came from.
bool pinned(void) const
Return TRUE if taking en passant is not allowed due to horizontal pinning.
The POD base type of class Index.
An object representing en passant information.
The index of a chess square.
Index index(void) const
Return the index of the square that was passed.
Index pawn_index(void) const
Return the index of the pawn that just advanced two squares.
bool exists(void) const
Return TRUE if the last move was a pawn advancing two squares.
uint8_t M_bits
00RRRCCC, where RRR is the row and CCC the column.
IndexData const index_end
A constant representing& #39;one past the end'.