X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FApocalypse.js;h=fc309155877bc3f037125c2fb35f77178ec8a761;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=2439ae5dcdf35b28d908a35b82c8e21963d66798;hpb=6e0f28425075e6d2d79cab6d30bca6ce6d55f19d;p=vchess.git diff --git a/client/src/variants/Apocalypse.js b/client/src/variants/Apocalypse.js index 2439ae5d..fc309155 100644 --- a/client/src/variants/Apocalypse.js +++ b/client/src/variants/Apocalypse.js @@ -2,6 +2,11 @@ import { ChessRules } from "@/base_rules"; import { randInt } from "@/utils/alea"; export class ApocalypseRules extends ChessRules { + + static get Options() { + return null; + } + static get PawnSpecs() { return Object.assign( {}, @@ -55,7 +60,7 @@ export class ApocalypseRules extends ChessRules { if (['P','p'].includes(row[i])) pawns[row[i]]++; if (V.PIECES.includes(row[i].toLowerCase())) sumElts++; else { - const num = parseInt(row[i]); + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -139,8 +144,8 @@ export class ApocalypseRules extends ChessRules { setFlags(fenflags) { this.penaltyFlags = { - 'w': parseInt(fenflags[0]), - 'b': parseInt(fenflags[1]) + 'w': parseInt(fenflags[0], 10), + 'b': parseInt(fenflags[1], 10) }; } @@ -512,4 +517,5 @@ export class ApocalypseRules extends ChessRules { V.CoordsToSquare(move.end) ); } + };