X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FTwokings.js;h=a5bd76afeb8e619a2f5e713001176ca2656beca9;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=68910e74c700aab7e70667fb4997ffada6082c55;hpb=d54f6261c9e30f4eabb402ad301dd5c5e40fb656;p=vchess.git diff --git a/client/src/variants/Twokings.js b/client/src/variants/Twokings.js index 68910e74..a5bd76af 100644 --- a/client/src/variants/Twokings.js +++ b/client/src/variants/Twokings.js @@ -2,6 +2,7 @@ import { ChessRules } from "@/base_rules"; import { CoregalRules } from "@/variants/Coregal"; export class TwokingsRules extends CoregalRules { + static get PawnSpecs() { return Object.assign( {}, @@ -21,7 +22,7 @@ export class TwokingsRules extends CoregalRules { if (['K','k'].includes(row[i])) kings[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; } @@ -36,7 +37,8 @@ export class TwokingsRules extends CoregalRules { // Not scanning king positions. In this variant, scan the board everytime. scanKings() {} - getCheckSquares(color) { + getCheckSquares() { + const color = this.turn; let squares = []; const oppCol = V.GetOppCol(color); for (let i=0; i