Key key, pawnKey, materialKey;
int castleRights, rule50;
Square epSquare;
- Move lastMove;
Value mgValue, egValue;
PieceType capture;
StateInfo* previous;
+ Move lastMove;
};
bool square_is_weak(Square s, Color c) const;
// Doing and undoing moves
+ void setStartState(const StateInfo& st);
void do_move(Move m, StateInfo& st);
void undo_move(Move m);
void do_null_move(StateInfo& st);
void allow_ooo(Color c);
// Helper functions for doing and undoing moves
+ void init_new_state(StateInfo& newSt);
void do_capture_move(Move m, PieceType capture, Color them, Square to);
void do_castle_move(Move m);
void do_promotion_move(Move m);
void undo_promotion_move(Move m);
void undo_ep_move(Move m);
void find_checkers();
+ void find_pinned();
template<PieceType Piece>
void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
return StepAttackBB[KING][s];
}
+inline Bitboard Position::pinned_pieces(Color c) const {
+ return st->pinned[c];
+}
+
+inline Bitboard Position::pinned_pieces(Color c, Bitboard& p) const {
+ p = st->pinners[c];
+ return st->pinned[c];
+}
+
+inline Bitboard Position::discovered_check_candidates(Color c) const {
+ return st->dcCandidates[c];
+}
+
inline Bitboard Position::checkers() const {
return st->checkersBB;
}