X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FFootball.js;h=430e31ac3d0e74e43c092856156ac3e433033264;hb=0f7762c1d87e21d1c13ff0f38bd234b64b0a29d9;hp=2acb24f4bb87f66730dd1c86b0d01b31bd1889b2;hpb=107dc1bd5361e2538b1551bdcc37c1e90a444b83;p=vchess.git diff --git a/client/src/variants/Football.js b/client/src/variants/Football.js index 2acb24f4..430e31ac 100644 --- a/client/src/variants/Football.js +++ b/client/src/variants/Football.js @@ -1,6 +1,8 @@ import { ChessRules } from "@/base_rules"; +import { SuicideRules } from "@/variants/Suicide"; export class FootballRules extends ChessRules { + static get HasFlags() { return false; } @@ -41,8 +43,9 @@ export class FootballRules extends ChessRules { if (V.PIECES.includes(lowerRi)) { pieces[row[i] == lowerRi ? "b" : "w"]++; sumElts++; - } else { - const num = parseInt(row[i]); + } + else { + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -77,4 +80,9 @@ export class FootballRules extends ChessRules { if (this.atLeastOneMove()) return "*"; return "1/2"; } + + static GenRandInitFen(randomness) { + return SuicideRules.GenRandInitFen(randomness); + } + };