X-Git-Url: https://git.auder.net/parser.js?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRecycle.js;h=82895f351d345410c70988f49291da6b5a1f86f4;hb=41c5b662cfbe236402f67f383b40c900b8e7965b;hp=a234350b094d50c8fc05c9069ce12f707561f0a0;hpb=7ba4a5bc5b64e19a1e7f26aa232d5c50770d07ad;p=vchess.git diff --git a/client/src/variants/Recycle.js b/client/src/variants/Recycle.js index a234350b..82895f35 100644 --- a/client/src/variants/Recycle.js +++ b/client/src/variants/Recycle.js @@ -18,6 +18,13 @@ export const VariantRules = class RecycleRules extends ChessRules { }); } + 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"; } @@ -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 (