X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSuction.js;h=4ddffbe45b1ca75b4f5d1bdc4e1229c1504024c7;hb=2f8dce6a81063289d9d4cbca7971f80b1b194b84;hp=aa34f6c7f6efc17df189a8e60618aebef4f1a580;hpb=81a0b2a9c4ad66bf3243f89cc1f3c12cf016c4b8;p=vchess.git diff --git a/client/src/variants/Suction.js b/client/src/variants/Suction.js index aa34f6c7..4ddffbe4 100644 --- a/client/src/variants/Suction.js +++ b/client/src/variants/Suction.js @@ -144,13 +144,22 @@ export class SuctionRules extends ChessRules { return ChessRules.GenRandInitFen(randomness).slice(0, -6) + "- -"; } - getFen() { + getCmoveFen() { const L = this.cmoves.length; - const cmoveFen = !this.cmoves[L - 1] - ? "-" - : ChessRules.CoordsToSquare(this.cmoves[L - 1].start) + - ChessRules.CoordsToSquare(this.cmoves[L - 1].end); - return super.getFen() + " " + cmoveFen; + return ( + !this.cmoves[L - 1] + ? "-" + : ChessRules.CoordsToSquare(this.cmoves[L - 1].start) + + ChessRules.CoordsToSquare(this.cmoves[L - 1].end) + ); + } + + getFen() { + return super.getFen() + " " + this.getCmoveFen(); + } + + getFenForRepeat() { + return super.getFenForRepeat() + "_" + this.getCmoveFen(); } postPlay(move) {