[BitBoard] Add fills and direction methods

This commit is contained in:
2022-12-22 11:18:23 +01:00
parent fbc1a5589a
commit 4157c9200e
3 changed files with 58 additions and 12 deletions

View File

@@ -133,10 +133,8 @@ void Board::handlePawnDoubleAdvance(const Move &move, BitBoard bb, const Piece &
auto fromR = move.from().rank();
auto toR = move.to().rank();
if (abs(static_cast<int>(fromR) - static_cast<int>(toR)) == 2) {
if (mPieceBBs[toIndex(PieceType::Pawn)]
& (bb.left(1) | bb.right(1))
& BitBoard::getRank(static_cast<int>(toR))) {
if (mPieceBBs[toIndex(PieceType::Pawn)] & mPieceBBs[toIndex(!mTurn)] // Get all other color pawns
& (bb.west() | bb.east())) { // is pawn left or right?
mEPS = Square::fromCoordinates(move.to().file(), std::max(fromR, toR) - 1);
return;
}
@@ -151,8 +149,7 @@ void Board::pseudoLegalMoves(MoveVec &moves) const {
(void) moves;
}
void Board::pseudoLegalMovesFrom(const Square &from,
Board::MoveVec &moves) const {
void Board::pseudoLegalMovesFrom(const Square &from, Board::MoveVec &moves) const {
(void) from;
(void) moves;
}