mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Update pinned bitboards and friends in do_move()
Probably is slightly slow, but code is surely better in this way. We will optimize later for speed. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -302,6 +302,7 @@ private:
|
||||
void undo_promotion_move(Move m);
|
||||
void undo_ep_move(Move m);
|
||||
void find_checkers();
|
||||
void find_pinned();
|
||||
|
||||
template<PieceType Piece>
|
||||
void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
|
||||
@@ -556,6 +557,19 @@ inline Bitboard Position::piece_attacks<KING>(Square s) const {
|
||||
return StepAttackBB[KING][s];
|
||||
}
|
||||
|
||||
inline Bitboard Position::pinned_pieces(Color c) const {
|
||||
return st->pinned[c];
|
||||
}
|
||||
|
||||
inline Bitboard Position::pinned_pieces(Color c, Bitboard& p) const {
|
||||
p = st->pinners[c];
|
||||
return st->pinned[c];
|
||||
}
|
||||
|
||||
inline Bitboard Position::discovered_check_candidates(Color c) const {
|
||||
return st->dcCandidates[c];
|
||||
}
|
||||
|
||||
inline Bitboard Position::checkers() const {
|
||||
return st->checkersBB;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user