const [x, y] = [square[0], square[1]];
if ((color == 'w' && x != 7) || (color == 'b' && x != 0)) return null;
const selectedPiece = this.board[x][y][1];
const [x, y] = [square[0], square[1]];
if ((color == 'w' && x != 7) || (color == 'b' && x != 0)) return null;
const selectedPiece = this.board[x][y][1];
if (this.movesCount > 4) {
let piece = move.vanish[0].p;
if (['j', 'l'].includes(piece)) piece = V.KING;
if (this.movesCount > 4) {
let piece = move.vanish[0].p;
if (['j', 'l'].includes(piece)) piece = V.KING;
this.updateCastleFlags(move, piece);
}
}
postUndo(move) {
if (this.movesCount >= 4) {
this.updateCastleFlags(move, piece);
}
}
postUndo(move) {
if (this.movesCount >= 4) {
if (['j', 'k', 'l'].includes(this.getPiece(move.start.x, move.start.y)))
if (['j', 'k', 'l'].includes(this.getPiece(move.start.x, move.start.y)))