mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Consolidate CastlingSide and CastlingRights
This is a non-functional simplification that removes CastlingSide and implements the functionality in CastlingRights (thanks to Jörg Oster for a comment on the first version of this patch). STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 53854 W: 12077 L: 12019 D: 29758 http://tests.stockfishchess.org/tests/view/5d517b940ebc5925cf107474 Closes https://github.com/official-stockfish/Stockfish/pull/2265 No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
a016626825
commit
3984b8f8f0
@@ -100,9 +100,9 @@ public:
|
||||
|
||||
// Castling
|
||||
int castling_rights(Color c) const;
|
||||
bool can_castle(CastlingRight cr) const;
|
||||
bool castling_impeded(CastlingRight cr) const;
|
||||
Square castling_rook_square(CastlingRight cr) const;
|
||||
bool can_castle(CastlingRights cr) const;
|
||||
bool castling_impeded(CastlingRights cr) const;
|
||||
Square castling_rook_square(CastlingRights cr) const;
|
||||
|
||||
// Checking
|
||||
Bitboard checkers() const;
|
||||
@@ -268,7 +268,7 @@ inline bool Position::is_on_semiopen_file(Color c, Square s) const {
|
||||
return !(pieces(c, PAWN) & file_bb(s));
|
||||
}
|
||||
|
||||
inline bool Position::can_castle(CastlingRight cr) const {
|
||||
inline bool Position::can_castle(CastlingRights cr) const {
|
||||
return st->castlingRights & cr;
|
||||
}
|
||||
|
||||
@@ -276,11 +276,11 @@ inline int Position::castling_rights(Color c) const {
|
||||
return st->castlingRights & (c == WHITE ? WHITE_CASTLING : BLACK_CASTLING);
|
||||
}
|
||||
|
||||
inline bool Position::castling_impeded(CastlingRight cr) const {
|
||||
inline bool Position::castling_impeded(CastlingRights cr) const {
|
||||
return byTypeBB[ALL_PIECES] & castlingPath[cr];
|
||||
}
|
||||
|
||||
inline Square Position::castling_rook_square(CastlingRight cr) const {
|
||||
inline Square Position::castling_rook_square(CastlingRights cr) const {
|
||||
return castlingRookSquare[cr];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user