X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FForward.js;h=e0a0f9ba11261311d873944c968dd60e55622ee9;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=5c5b641d551edda107c125e3a04be323e9769536;hpb=0b8bd1214d662f6b1964f0807eda114ed1cac3c4;p=vchess.git diff --git a/client/src/variants/Forward.js b/client/src/variants/Forward.js index 5c5b641d..e0a0f9ba 100644 --- a/client/src/variants/Forward.js +++ b/client/src/variants/Forward.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class ForwardRules extends ChessRules { + static get PawnSpecs() { return Object.assign( {}, @@ -26,7 +27,6 @@ export class ForwardRules extends ChessRules { } scanKings(fen) { - this.INIT_COL_KING = { w: -1, b: -1 }; // Squares of white and black king: this.kingPos = { w: [-1, -1], b: [-1, -1] }; const fenRows = V.ParseFen(fen).position.split("/"); @@ -38,15 +38,13 @@ export class ForwardRules extends ChessRules { case "k": case "l": this.kingPos["b"] = [i, k]; - this.INIT_COL_KING["b"] = k; break; case "K": case "L": this.kingPos["w"] = [i, k]; - this.INIT_COL_KING["w"] = k; break; default: { - const num = parseInt(fenRows[i].charAt(j)); + const num = parseInt(fenRows[i].charAt(j), 10); if (!isNaN(num)) k += num - 1; } } @@ -140,4 +138,5 @@ export class ForwardRules extends ChessRules { ChessRules.VALUES ); } + };