- case PAWN:
- if (bit_is_set(pawn_attacks(them, ksq), to))
- set_bit(&checkersBB, to);
-
- if (bit_is_set(dcCandidates, from))
- checkersBB |= ( (piece_attacks<ROOK>(ksq) & rooks_and_queens(us))
- |(piece_attacks<BISHOP>(ksq) & bishops_and_queens(us)));
- break;
-
- case KNIGHT:
- if (bit_is_set(piece_attacks<KNIGHT>(ksq), to))
- set_bit(&checkersBB, to);
-
- if (bit_is_set(dcCandidates, from))
- checkersBB |= ( (piece_attacks<ROOK>(ksq) & rooks_and_queens(us))
- |(piece_attacks<BISHOP>(ksq) & bishops_and_queens(us)));
- break;
-
- case BISHOP:
- if (bit_is_set(piece_attacks<BISHOP>(ksq), to))
- set_bit(&checkersBB, to);
-
- if (bit_is_set(dcCandidates, from))
- checkersBB |= (piece_attacks<ROOK>(ksq) & rooks_and_queens(us));
- break;
-
- case ROOK:
- if (bit_is_set(piece_attacks<ROOK>(ksq), to))
- set_bit(&checkersBB, to);
-
- if (bit_is_set(dcCandidates, from))
- checkersBB |= (piece_attacks<BISHOP>(ksq) & bishops_and_queens(us));
- break;
-
- case QUEEN:
- if (bit_is_set(piece_attacks<QUEEN>(ksq), to))
- set_bit(&checkersBB, to);
- break;
-
- case KING:
- if (bit_is_set(dcCandidates, from))
- checkersBB |= ( (piece_attacks<ROOK>(ksq) & rooks_and_queens(us))
- |(piece_attacks<BISHOP>(ksq) & bishops_and_queens(us)));
- break;
-
- default:
- assert(false);
- break;
+ case PAWN: update_checkers<PAWN>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ case KNIGHT: update_checkers<KNIGHT>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ case BISHOP: update_checkers<BISHOP>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ case ROOK: update_checkers<ROOK>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ case QUEEN: update_checkers<QUEEN>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ case KING: update_checkers<KING>(&(st->checkersBB), ksq, from, to, dcCandidates); break;
+ default: assert(false); break;