[Board] Implement EnPassant handling
This commit is contained in:
12
Board.hpp
12
Board.hpp
@@ -47,7 +47,7 @@ private:
|
||||
|
||||
PieceColor mTurn = PieceColor::White;
|
||||
CastlingRights mCR = CastlingRights::None;
|
||||
unsigned mEPS = 64;
|
||||
std::optional<Square> mEPS;
|
||||
|
||||
enum DefinedBoards : BitBoard {
|
||||
AFile = 0x0101010101010101,
|
||||
@@ -80,6 +80,14 @@ private:
|
||||
return (1ULL << i);
|
||||
}
|
||||
|
||||
static inline BitBoard genShift(BitBoard x, const int s) {
|
||||
return (s < 0) ? (x >> -s) : (s > 63) ? x : (x << s);
|
||||
}
|
||||
|
||||
static inline BitBoard getRankBB(int r) {
|
||||
return (genShift(1ULL, (r + 1) * 8) - 1) & genShift(~1ULL, r * 8 - 1);
|
||||
}
|
||||
|
||||
static inline int toIndex(PieceType t) {
|
||||
return static_cast<int>(t);
|
||||
}
|
||||
@@ -118,6 +126,8 @@ private:
|
||||
static inline int getLSB(const BitBoard b) {
|
||||
return __builtin_ctzll(b);
|
||||
}
|
||||
|
||||
void handlePawnDoubleAdvance(const Move &move, BitBoard bb, const Piece &movedPiece);
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Board &board);
|
||||
|
Reference in New Issue
Block a user