OF6NBX4Y6UWXBSSENWBBYH3AU4TI5FCD5S7WKYMINBUBCKA2MD4AC
// make sure the move is valid (no check)
const king_square = switch (self.side) {
.white => @intToEnum(Square, @ctz(
@bitCast(BoardType, self.bitboards[Chess.PE.K.int()]),
)),
.black => @intToEnum(Square, @ctz(
@bitCast(BoardType, self.bitboards[Chess.PE.k.int()]),
)),
};
if (self.isSquareAttacked(king_square, self.enemy)) {
self.restore(bckup);
return false;
}
return true;