fixed illegal castling

This commit is contained in:
rektdie committed 2025-03-24 18:21:07 +01:00
1 parent 2943fccce6
commit b9792e56da
5 files changed
+52 -6

No files matched your search

+9
View File
@@ -14,6 +14,7 @@ void Board::Reset() {
pieces = std::array<Bitboard, 6>();
colors = std::array<Bitboard, 2>();
threatMaps = std::array<std::array<U64, 64>, 2>();
moveList = std::array<Move, 218>();
@@ -128,6 +129,14 @@ void Board::ResetMoves() {
currentMoveIndex = 0;
}
U64 Board::GetThreatMaps(bool side) {
U64 combined = 0ULL;
for (int type = Pawn; type <= King; type++) {
combined |= threatMaps[side][type];
}
return combined;
}
void Board::ListMoves() {
for (int i = 0; i < currentMoveIndex; i++) {
std::cout << i+1 << ". ";