// Initialization helpers (used while setting up a position)
void clear();
void set_castling_right(Color c, Square rfrom);
+ void set_state(StateInfo* si) const;
// Helper functions
void do_castling(Square kfrom, Square kto, Square rfrom, Square rto);
void remove_piece(Square s, Color c, PieceType pt);
void move_piece(Square from, Square to, Color c, PieceType pt);
- // Computing hash keys from scratch (for initialization and debugging)
- Key compute_key() const;
- Key compute_pawn_key() const;
- Key compute_material_key() const;
-
- // Computing incremental evaluation scores and material counts
- Score compute_psq_score() const;
- Value compute_non_pawn_material(Color c) const;
-
// Board and pieces
Piece board[SQUARE_NB];
Bitboard byTypeBB[PIECE_TYPE_NB];
template<PieceType Pt>
inline Bitboard Position::attacks_from(Square s) const {
- return Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, pieces())
+ return Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, byTypeBB[ALL_PIECES])
: Pt == QUEEN ? attacks_from<ROOK>(s) | attacks_from<BISHOP>(s)
: StepAttacksBB[Pt][s];
}