+/// Position::set_check_info() sets king attacks to detect if a move gives check
+
+void Position::set_check_info(CheckInfo* ci) const {
+
+ ci->blockersForKing[WHITE] = slider_blockers(pieces(BLACK), square<KING>(WHITE));
+ ci->blockersForKing[BLACK] = slider_blockers(pieces(WHITE), square<KING>(BLACK));
+
+ Square ksq = ci->ksq = square<KING>(~sideToMove);
+
+ ci->checkSquares[PAWN] = attacks_from<PAWN>(ksq, ~sideToMove);
+ ci->checkSquares[KNIGHT] = attacks_from<KNIGHT>(ksq);
+ ci->checkSquares[BISHOP] = attacks_from<BISHOP>(ksq);
+ ci->checkSquares[ROOK] = attacks_from<ROOK>(ksq);
+ ci->checkSquares[QUEEN] = ci->checkSquares[BISHOP] | ci->checkSquares[ROOK];
+ ci->checkSquares[KING] = 0;
+}
+
+