X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FThreechecks.js;h=05250596960c684011f554fbf6a91b6a29a2814e;hb=e50a802531b99829c533f22ecd21e359e7e1e049;hp=3aa6db9860db5679e59b842a2d13ce6cf3582136;hpb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;p=vchess.git diff --git a/client/src/variants/Threechecks.js b/client/src/variants/Threechecks.js index 3aa6db98..05250596 100644 --- a/client/src/variants/Threechecks.js +++ b/client/src/variants/Threechecks.js @@ -1,6 +1,6 @@ import { ChessRules } from "@/base_rules"; -export const VariantRules = class ThreechecksRules extends ChessRules { +export class ThreechecksRules extends ChessRules { static IsGoodFlags(flags) { // 4 for castle + 2 for checks (0,1 or 2) return !!flags.match(/^[01]{4,4}[012]{2,2}$/); @@ -11,7 +11,7 @@ export const VariantRules = class ThreechecksRules extends ChessRules { this.checkFlags = { w: 0, b: 0 }; const flags = fenflags.substr(4); //skip first 4 digits, for castle for (let c of ["w", "b"]) { - this.checkFlags[c] = parseInt(flags.charAt(c == "w" ? 0 : 1)); + this.checkFlags[c] = parseInt(flags.charAt(c == "w" ? 0 : 1), 10); } } @@ -25,7 +25,7 @@ export const VariantRules = class ThreechecksRules extends ChessRules { } getPpath(b) { - // TODO: !!this.checkFlags condition for printDiagram, but clearly not good. + // TODO: !!this.checkFlags condition for printDiagram, but it's not good. // This is just a temporary fix. if (b[1] == 'k' && !!this.checkFlags && this.checkFlags[b[0]] > 0) return "Threechecks/" + b[0] + 'k_' + this.checkFlags[b[0]];