X-Git-Url: https://git.auder.net/js/rpsls.js?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSchess.js;h=d8e1b1c5c9a08e84ca62690d6cf8f90876870a03;hb=eaa5ad3e93b761fefb16b32071be0b439761f843;hp=95118982ec155c3e372bd5c77ea0a6e039947c5b;hpb=e50a802531b99829c533f22ecd21e359e7e1e049;p=vchess.git diff --git a/client/src/variants/Schess.js b/client/src/variants/Schess.js index 95118982..d8e1b1c5 100644 --- a/client/src/variants/Schess.js +++ b/client/src/variants/Schess.js @@ -1,6 +1,7 @@ import { ChessRules, PiPo } from "@/base_rules"; export class SchessRules extends ChessRules { + static get PawnSpecs() { return Object.assign( {}, @@ -341,7 +342,14 @@ export class SchessRules extends ChessRules { const nothingAppear = (move.appear[0].p == V.NOTHING); if (pPieceAppear || nothingAppear) { let suffix = ""; - if (pPieceAppear) suffix = "/" + move.appear[0].p.toUpperCase(); + if (pPieceAppear) { + suffix = "/" + move.appear[0].p.toUpperCase(); + if (move.appear.length == 3) { + // Castling; indicate square + suffix += + V.CoordsToSquare({ x: move.appear[0].x, y: move.appear[0].y }); + } + } let cmove = JSON.parse(JSON.stringify(move)); cmove.appear.shift(); return super.getNotation(cmove) + suffix; @@ -349,4 +357,5 @@ export class SchessRules extends ChessRules { } return super.getNotation(move); } + };