X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRococo.js;h=66d9615a33136a5fabf6b4c08b5df7bc986fbabe;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=f075fe84f31f7effd5e0dffdd52ca32f9e7fddc8;hpb=93ce6119a67b8510762dd68a07936b6f22f2ad67;p=vchess.git diff --git a/client/src/variants/Rococo.js b/client/src/variants/Rococo.js index f075fe84..66d9615a 100644 --- a/client/src/variants/Rococo.js +++ b/client/src/variants/Rococo.js @@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array"; import { shuffle } from "@/utils/alea"; export class RococoRules extends ChessRules { + static get HasFlags() { return false; } @@ -15,6 +16,15 @@ export class RococoRules extends ChessRules { return ChessRules.PIECES.concat([V.IMMOBILIZER]); } + static get Lines() { + return [ + [[1, 1], [1, 9]], + [[1, 9], [9, 9]], + [[9, 9], [9, 1]], + [[9, 1], [1, 1]] + ]; + } + getPpath(b) { if (b[1] == "m") //'m' for Immobilizer (I is too similar to 1) @@ -45,7 +55,7 @@ export class RococoRules extends ChessRules { this.kingPos["w"] = [i, k]; break; default: { - const num = parseInt(position[i].charAt(j)); + const num = parseInt(position[i].charAt(j), 10); if (!isNaN(num)) k += num - 1; } } @@ -712,4 +722,5 @@ export class RococoRules extends ChessRules { if (move.vanish.length > 1 && move.appear[0].p != V.KING) notation += "X"; return notation; } + };