{
initVariables(fen)
{
- // No castling, hence no flags
const epSq = this.moves.length > 0 ? this.getEpSquare(this.lastMove) : undefined;
this.epSquares = [ epSq ];
}
- setFlags(fen) { }
+ setFlags(fen)
+ {
+ // No castling, hence no flags; but flags defined for compatibility
+ this.castleFlags = { "w":[false,false], "b":[false,false] };
+ }
getPotentialPawnMoves([x,y])
{
const lastRank = (color == "w" ? 0 : sizeX-1);
if (x+shift == lastRank)
{
- let p = V.KING;
// Normal move
if (this.board[x+shift][y] == V.EMPTY)
- moves.push(this.getBasicMove([x,y], [x+shift,y], {c:color,p:p}));
+ moves.push(this.getBasicMove([x,y], [x+shift,y], {c:color,p:V.KING}));
// Captures
- if (y>0 && this.canTake([x,y], [x+shift,y-1]) && this.board[x+shift][y-1] != V.EMPTY)
- moves.push(this.getBasicMove([x,y], [x+shift,y-1], {c:color,p:p}));
- if (y<sizeY-1 && this.canTake([x,y], [x+shift,y+1]) && this.board[x+shift][y+1] != V.EMPTY)
- moves.push(this.getBasicMove([x,y], [x+shift,y+1], {c:color,p:p}));
+ if (y>0 && this.canTake([x,y], [x+shift,y-1])
+ && this.board[x+shift][y-1] != V.EMPTY)
+ {
+ moves.push(this.getBasicMove([x,y], [x+shift,y-1], {c:color,p:V.KING}));
+ }
+ if (y<sizeY-1 && this.canTake([x,y], [x+shift,y+1])
+ && this.board[x+shift][y+1] != V.EMPTY)
+ {
+ moves.push(this.getBasicMove([x,y], [x+shift,y+1], {c:color,p:V.KING}));
+ }
}
return moves;
return [];
}
- play(move, ingame)
- {
- if (!!ingame)
- move.notation = this.getNotation(move);
- this.moves.push(move);
- this.epSquares.push( this.getEpSquare(move) );
- VariantRules.PlayOnBoard(this.board, move);
- }
+ // Unused:
+ updateVariables(move) { }
+ unupdateVariables(move) { }
+ parseFlags(flags) { }
- undo(move)
+ getFlagsFen()
{
- VariantRules.UndoOnBoard(this.board, move);
- this.epSquares.pop();
- this.moves.pop();
+ return "-";
}
checkGameEnd()