mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Refactor Position::pinned_pieces() to use templates
Also better document this interesting function. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+3
-1
@@ -197,6 +197,8 @@ public:
|
||||
// Bitboards for pinned pieces and discovered check candidates
|
||||
Bitboard discovered_check_candidates(Color c) const;
|
||||
Bitboard pinned_pieces(Color c) const;
|
||||
template<PieceType Piece>
|
||||
Bitboard pinned_pieces(Color c, Square ksq) const;
|
||||
|
||||
// Checking pieces
|
||||
Bitboard checkers() const;
|
||||
@@ -553,7 +555,7 @@ inline Bitboard Position::checkers() const {
|
||||
}
|
||||
|
||||
inline bool Position::is_check() const {
|
||||
return checkers() != EmptyBoardBB;
|
||||
return checkersBB != EmptyBoardBB;
|
||||
}
|
||||
|
||||
inline bool Position::pawn_attacks_square(Color c, Square f, Square t) const {
|
||||
|
||||
Reference in New Issue
Block a user