X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=cf0677799c6ea34b5bcf6271715ecd71bf90ca27;hp=ff376386cac85dd6f3129bdbc5649f7945f8d3f8;hb=f99cb3dc27719021e126690b7fd5aa5f43663ed8;hpb=dd4e5db2be2eb5631d739af634cb33bea2f3fddd diff --git a/src/types.h b/src/types.h index ff376386..cf067779 100644 --- a/src/types.h +++ b/src/types.h @@ -97,7 +97,7 @@ const int MAX_PLY_PLUS_6 = MAX_PLY + 6; /// 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 @@ -112,17 +112,17 @@ enum MoveType { 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 { @@ -346,8 +346,8 @@ inline Piece make_piece(Color c, PieceType pt) { 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) {