//// Types
////
+/// struct checkInfo is initialized at c'tor time and keeps
+/// info used to detect if a move gives check.
+
+struct CheckInfo {
+
+ CheckInfo(const Position&);
+
+ Square ksq;
+ Bitboard dcCandidates;
+ Bitboard checkSq[8];
+};
+
/// Castle rights, encoded as bit fields
enum CastleRights {
/// must be passed as a parameter.
struct StateInfo {
- Key key, pawnKey, materialKey;
+ Key pawnKey, materialKey;
int castleRights, rule50, pliesFromNull;
Square epSquare;
Score value;
Value npMaterial[2];
+ Key key;
PieceType capture;
Bitboard checkersBB;
StateInfo* previous;
bool pl_move_is_legal(Move m, Bitboard pinned) const;
bool pl_move_is_evasion(Move m, Bitboard pinned) const;
bool move_is_check(Move m) const;
- bool move_is_check(Move m, Bitboard dcCandidates) const;
+ bool move_is_check(Move m, const CheckInfo& ci) const;
bool move_is_capture(Move m) const;
bool move_is_capture_or_promotion(Move m) const;
bool move_is_passed_pawn_push(Move m) const;