/// bit 0- 5: destination square (from 0 to 63)
/// bit 6-11: origin square (from 0 to 63)
/// bit 12-13: promotion piece type - 2 (from KNIGHT-2 to QUEEN-2)
-/// bit 14-15: special move flag: promotion (1), en passant (2), castle (3)
+/// bit 14-15: special move flag: promotion (1), en passant (2), castling (3)
///
/// Special cases are MOVE_NONE and MOVE_NULL. We can sneak these in because in
/// any normal move destination square is always different from origin square
NORMAL,
PROMOTION = 1 << 14,
ENPASSANT = 2 << 14,
- CASTLE = 3 << 14
+ CASTLING = 3 << 14
};
-enum CastleRight { // Defined as in PolyGlot book hash key
- CASTLES_NONE,
+enum CastlingFlag { // Defined as in PolyGlot book hash key
+ NO_CASTLING,
WHITE_OO,
WHITE_OOO = WHITE_OO << 1,
BLACK_OO = WHITE_OO << 2,
BLACK_OOO = WHITE_OO << 3,
- ALL_CASTLES = WHITE_OO | WHITE_OOO | BLACK_OO | BLACK_OOO,
- CASTLE_RIGHT_NB = 16
+ ANY_CASTLING = WHITE_OO | WHITE_OOO | BLACK_OO | BLACK_OOO,
+ CASTLING_FLAG_NB = 16
};
enum CastlingSide {
return Piece((c << 3) | pt);
}
-inline CastleRight make_castle_right(Color c, CastlingSide s) {
- return CastleRight(WHITE_OO << ((s == QUEEN_SIDE) + 2 * c));
+inline CastlingFlag make_castling_flag(Color c, CastlingSide s) {
+ return CastlingFlag(WHITE_OO << ((s == QUEEN_SIDE) + 2 * c));
}
inline PieceType type_of(Piece p) {