Key key, pawnKey, materialKey;
int rule50;
Move lastMove;
- PieceType capture;
Value mgValue, egValue;
+ PieceType capture;
};
void undo_ep_move(Move m);
void find_checkers();
+ template<PieceType Piece>
+ void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
+
template<PieceType Piece, bool FindPinned>
Bitboard hidden_checks(Color c, Square ksq) const;
return StepAttackBB[pawn_of_color(c)][s];
}
+template<>
+inline Bitboard Position::piece_attacks<PAWN>(Square s) const {
+ return StepAttackBB[pawn_of_color(opposite_color(sideToMove))][s];
+}
+
template<>
inline Bitboard Position::piece_attacks<KNIGHT>(Square s) const {
return StepAttackBB[KNIGHT][s];
return bit_is_set(piece_attacks<Piece>(f), t);
}
+inline Bitboard Position::attacks_to(Square s, Color c) const {
+
+ return attacks_to(s) & pieces_of_color(c);
+}
+
+inline bool Position::square_is_attacked(Square s, Color c) const {
+
+ return attacks_to(s, c) != EmptyBoardBB;
+}
+
inline bool Position::pawn_is_passed(Color c, Square s) const {
return !(pawns(opposite_color(c)) & passed_pawn_mask(c, s));
}