Revert "encapsulated positionIndex and moved isdraw to board class"

This reverts commit aa0d34eb8e.
This commit is contained in:
rektdie committed 2025-04-12 10:59:04 +02:00
1 parent 3275cee01e
commit ce01c7756b
7 files changed
+41 -35

No files matched your search

-27
View File
@@ -28,8 +28,6 @@ void Board::Reset() {
currentMoveIndex = 0;
positionIndex = 0;
hashKey = 0ULL;
}
@@ -443,29 +441,4 @@ void Board::ResetAccPair() {
blackPieces.PopBit(square);
}
}
static bool IsThreefold(Board& board) {
for (int i = 0; i < board.positionIndex; i++) {
if (positionHistory[i] == board.hashKey) {
// repetition found
return true;
}
}
// no repetition
return false;
}
static bool IsFifty(Board& board) {
return (board.halfMoves >= 100);
}
static bool IsInsuffMat(Board& board) {
return (board.occupied.PopCount() <= 3
&& !(board.pieces[Pawn] | board.pieces[Queen] | board.pieces[Rook]));
}
bool Board::IsDraw() {
return IsFifty(*this) || IsInsuffMat(*this) || IsThreefold(*this);
}