X-Git-Url: https://git.auder.net/js/rpsls.js?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRecycle.js;h=82895f351d345410c70988f49291da6b5a1f86f4;hb=bbf668379ae5980d5068dd76cf907c87ce7ed648;hp=d99228cd0d6b7aab2c16045dfb25617dc429118a;hpb=78d64531113d4b5045ff588dd43f301a332ebae8;p=vchess.git diff --git a/client/src/variants/Recycle.js b/client/src/variants/Recycle.js index d99228cd..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 ( @@ -74,7 +91,7 @@ export const VariantRules = class RecycleRules extends ChessRules { } // Used by the interface: - getReservePpath(color, index) { + getReservePpath(index, color) { return color + V.RESERVE_PIECES[index]; }