template<PieceType Pt> const Square* list(Color c) const;
// Castling
- int can_castle(CastlingFlag f) const;
int can_castle(Color c) const;
- bool castling_impeded(Color c, CastlingSide s) const;
- Square castling_rook_square(Color c, CastlingSide s) const;
+ int can_castle(CastlingFlag f) const;
+ bool castling_impeded(CastlingFlag f) const;
+ Square castling_rook_square(CastlingFlag f) const;
// Checking
Bitboard checkers() const;
void undo_null_move();
// Static exchange evaluation
- int see(Move m) const;
- int see_sign(Move m) const;
+ Value see(Move m) const;
+ Value see_sign(Move m) const;
// Accessing hash keys
Key key() const;
// Other info
int castlingFlagsMask[SQUARE_NB];
- Square castlingRookSquare[COLOR_NB][CASTLING_SIDE_NB];
- Bitboard castlingPath[COLOR_NB][CASTLING_SIDE_NB];
+ Square castlingRookSquare[CASTLING_FLAG_NB];
+ Bitboard castlingPath[CASTLING_FLAG_NB];
StateInfo startState;
uint64_t nodes;
int gamePly;
Color sideToMove;
Thread* thisThread;
StateInfo* st;
- int chess960;
+ bool chess960;
};
inline uint64_t Position::nodes_searched() const {
return st->castlingFlags & ((WHITE_OO | WHITE_OOO) << (2 * c));
}
-inline bool Position::castling_impeded(Color c, CastlingSide s) const {
- return byTypeBB[ALL_PIECES] & castlingPath[c][s];
+inline bool Position::castling_impeded(CastlingFlag f) const {
+ return byTypeBB[ALL_PIECES] & castlingPath[f];
}
-inline Square Position::castling_rook_square(Color c, CastlingSide s) const {
- return castlingRookSquare[c][s];
+inline Square Position::castling_rook_square(CastlingFlag f) const {
+ return castlingRookSquare[f];
}
template<PieceType Pt>
byTypeBB[ALL_PIECES] |= s;
byTypeBB[pt] |= s;
byColorBB[c] |= s;
- pieceCount[c][ALL_PIECES]++;
index[s] = pieceCount[c][pt]++;
pieceList[c][pt][index[s]] = s;
}
byTypeBB[pt] ^= s;
byColorBB[c] ^= s;
/* board[s] = NO_PIECE; */ // Not needed, will be overwritten by capturing
- pieceCount[c][ALL_PIECES]--;
Square lastSquare = pieceList[c][pt][--pieceCount[c][pt]];
index[lastSquare] = index[s];
pieceList[c][pt][index[lastSquare]] = lastSquare;