mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Unify pinned and discovery checks code
Templates are our friends here. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -197,8 +197,6 @@ 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;
|
||||
@@ -307,6 +305,9 @@ private:
|
||||
void undo_ep_move(Move m);
|
||||
void find_checkers();
|
||||
|
||||
template<PieceType Piece, bool FindPinned>
|
||||
Bitboard hidden_checks(Color c, Square ksq) const;
|
||||
|
||||
// Computing hash keys from scratch (for initialization and debugging)
|
||||
Key compute_key() const;
|
||||
Key compute_pawn_key() const;
|
||||
|
||||
Reference in New Issue
Block a user