- return pinned;
-}
-
-
-/// Position:pinned_pieces() returns a bitboard of all pinned (against the
-/// king) pieces for the given color.
-Bitboard Position::pinned_pieces(Color c) const {
-
- Square ksq = king_square(c);
- return pinned_pieces<ROOK>(c, ksq) | pinned_pieces<BISHOP>(c, ksq);
-}
-
-
-/// Position:discovered_check_candidates() returns a bitboard containing all
-/// pieces for the given side which are candidates for giving a discovered
-/// check. The code is almost the same as the function for finding pinned
-/// pieces.
-
-Bitboard Position::discovered_check_candidates(Color c) const {
- Bitboard b1, b2, dc, checkers, sliders;
- Square ksq = king_square(opposite_color(c)), s;
-
- dc = EmptyBoardBB;
- b1 = occupied_squares();
-
- sliders = rooks_and_queens(c);
- if(sliders & RookPseudoAttacks[ksq]) {
- b2 = piece_attacks<ROOK>(ksq) & pieces_of_color(c);
- checkers = rook_attacks_bb(ksq, b1 ^ b2) & sliders;
- while(checkers) {
- s = pop_1st_bit(&checkers);
- dc |= (squares_between(s, ksq) & b2);
- }
- }
-
- sliders = bishops_and_queens(c);
- if(sliders & BishopPseudoAttacks[ksq]) {
- b2 = piece_attacks<BISHOP>(ksq) & pieces_of_color(c);
- checkers = bishop_attacks_bb(ksq, b1 ^ b2) & sliders;
- while(checkers) {
- s = pop_1st_bit(&checkers);
- dc |= (squares_between(s, ksq) & b2);
- }
- }
-
- return dc;