[Board] Implement castlingRights and enPassantSquare
This commit is contained in:
@@ -41,19 +41,19 @@ PieceColor Board::turn() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Board::setCastlingRights(CastlingRights cr) {
|
void Board::setCastlingRights(CastlingRights cr) {
|
||||||
(void) cr;
|
mCr = cr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CastlingRights Board::castlingRights() const {
|
CastlingRights Board::castlingRights() const {
|
||||||
return CastlingRights::None;
|
return mCr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::setEnPassantSquare(const Square::Optional &square) {
|
void Board::setEnPassantSquare(const Square::Optional &square) {
|
||||||
(void) square;
|
mEPS = square->index();
|
||||||
}
|
}
|
||||||
|
|
||||||
Square::Optional Board::enPassantSquare() const {
|
Square::Optional Board::enPassantSquare() const {
|
||||||
return std::nullopt;
|
return Square::fromIndex(mEPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Board::makeMove(const Move &move) {
|
void Board::makeMove(const Move &move) {
|
||||||
|
@@ -40,6 +40,8 @@ private:
|
|||||||
|
|
||||||
BitBoard mPieceBBs[BB_NUM] = {};
|
BitBoard mPieceBBs[BB_NUM] = {};
|
||||||
PieceColor mTurn = PieceColor::White;
|
PieceColor mTurn = PieceColor::White;
|
||||||
|
CastlingRights mCr;
|
||||||
|
unsigned mEPS = 64;
|
||||||
|
|
||||||
static inline void clearIndex(BitBoard &b, unsigned i) {
|
static inline void clearIndex(BitBoard &b, unsigned i) {
|
||||||
b &= ~(1ULL << i);
|
b &= ~(1ULL << i);
|
||||||
|
Reference in New Issue
Block a user