X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRecycle.js;h=82895f351d345410c70988f49291da6b5a1f86f4;hb=41c5b662cfbe236402f67f383b40c900b8e7965b;hp=50ccd74e7d3997ec40d139cb460fc5ca5e79d7a6;hpb=241bf8f2a9a2c48d793aeb0b1d20207f6371de70;p=vchess.git diff --git a/client/src/variants/Recycle.js b/client/src/variants/Recycle.js index 50ccd74e..82895f35 100644 --- a/client/src/variants/Recycle.js +++ b/client/src/variants/Recycle.js @@ -18,8 +18,15 @@ export const VariantRules = class RecycleRules extends ChessRules { }); } - static GenRandInitFen() { - return ChessRules.GenRandInitFen() + " 0000000000"; + getEpSquare(moveOrSquare) { + if (typeof moveOrSquare !== "object" || moveOrSquare.vanish.length > 0) + return super.getEpSquare(moveOrSquare); + // Landing move: no en-passant + return undefined; + } + + static GenRandInitFen(randomness) { + return ChessRules.GenRandInitFen(randomness) + " 0000000000"; } getFen() { @@ -28,6 +35,16 @@ export const VariantRules = class RecycleRules extends ChessRules { ); } + getFenForRepeat() { + return ( + this.getBaseFen() + "_" + + this.getTurnFen() + "_" + + this.getFlagsFen() + "_" + + this.getEnpassantFen() + "_" + + this.getReserveFen() + ); + } + getReserveFen() { let counts = new Array(10); for (