X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCheckered.js;h=9de46ff1bca14558312086bf1e22433a0fa23128;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=eee21b82af84b6bcdad9f611a68ce0ab5957856b;hpb=f6dbe8e31a3260487664f1e0b50710b3f3efaf5f;p=vchess.git diff --git a/public/javascripts/variants/Checkered.js b/public/javascripts/variants/Checkered.js index eee21b82..9de46ff1 100644 --- a/public/javascripts/variants/Checkered.js +++ b/public/javascripts/variants/Checkered.js @@ -181,15 +181,15 @@ class CheckeredRules extends ChessRules underCheck(color) { - return this.isAttacked(this.kingPos[color], [this.getOppCol(color),'c']); + return this.isAttacked(this.kingPos[color], [V.GetOppCol(color),'c']); } getCheckSquares(color) { // Artifically change turn, for checkered pawns - this.turn = this.getOppCol(color); + this.turn = V.GetOppCol(color); const kingAttacked = this.isAttacked( - this.kingPos[color], [this.getOppCol(color),'c']); + this.kingPos[color], [V.GetOppCol(color),'c']); let res = kingAttacked ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! : []; @@ -210,11 +210,11 @@ class CheckeredRules extends ChessRules { const color = this.turn; // Artifically change turn, for checkered pawns - this.turn = this.getOppCol(this.turn); - const res = this.isAttacked(this.kingPos[color], [this.getOppCol(color),'c']) + this.turn = V.GetOppCol(this.turn); + const res = this.isAttacked(this.kingPos[color], [V.GetOppCol(color),'c']) ? (color == "w" ? "0-1" : "1-0") : "1/2"; - this.turn = this.getOppCol(this.turn); + this.turn = V.GetOppCol(this.turn); return res; } @@ -278,7 +278,7 @@ class CheckeredRules extends ChessRules if (move.vanish.length > 1) { // Capture - const startColumn = V.GetColumn(move.start.y); + const startColumn = V.CoordToColumn(move.start.y); notation = startColumn + "x" + finalSquare + "=" + move.appear[0].p.toUpperCase(); } @@ -299,5 +299,3 @@ class CheckeredRules extends ChessRules } } } - -const VariantRules = CheckeredRules;