void set_nodes_searched(int64_t n);
// Position consistency check, for debugging
- bool is_ok(int* failedStep = NULL) const;
+ bool pos_is_ok(int* failedStep = NULL) const;
void flip_me();
// Global initialization
// Initialization helper functions (used while setting up a position)
void clear();
void put_piece(Piece p, Square s);
- void set_castle(int f, Square ksq, Square rsq);
- void set_castling_rights(char token);
+ void set_castle_right(Square ksq, Square rsq);
bool move_is_legal(const Move m) const;
// Helper functions for doing and undoing moves
// Static variables
static Score pieceSquareTable[16][64]; // [piece][square]
- static Key zobrist[2][8][64]; // [color][pieceType][square]
+ static Key zobrist[2][8][64]; // [color][pieceType][square]/[piece count]
static Key zobEp[64]; // [square]
static Key zobCastle[16]; // [castleRight]
static Key zobSideToMove;
return attacks_from<ROOK>(s) | attacks_from<BISHOP>(s);
}
+inline Bitboard Position::attacks_from(Piece p, Square s) const {
+ return attacks_from(p, s, occupied_squares());
+}
+
+inline Bitboard Position::attackers_to(Square s) const {
+ return attackers_to(s, occupied_squares());
+}
+
inline Bitboard Position::checkers() const {
return st->checkersBB;
}