- const whiteLine = (akPos[0] > 0 ? akPos[0] : "") + 'A' + (akPos < this.size.y - 1 ? ...);
- const blackLine = ...
- return baseFen.replace(...)
+ const antikingLine = (color) => {
+ const [idx, symbol] = (color == 'w' ? [0, 'a'] : [1, 'A']);
+ return (
+ (akPos[idx] > 0 ? akPos[idx] : "") + symbol +
+ (akPos[idx] < this.size.y - 1
+ ? C.FenEmptySquares(this.size.y - 1 - akPos[idx])
+ : "")
+ );
+ };
+ return {
+ fen: baseFen.fen.replace("p/8", "p/" + antikingLine('b'))
+ .replace("8/P", antikingLine('w') + "/P"),
+ o: baseFen.o
+ };
+ }
+
+ getCastleMoves([x, y]) {
+ if (this.getPiece(x, y) == 'a')
+ return [];
+ return super.getCastleMoves([x, y]);
+ }
+
+ updateCastleFlags(move) {
+ if (move.vanish.length > 0 && move.vanish[0].p == 'a')
+ return;
+ super.updateCastleFlags(move);