X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCheckered.js;h=9de46ff1bca14558312086bf1e22433a0fa23128;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=4a9419a8ad88e7d36953d01881181dd6eee81c61;hpb=26c1e3bd4d3e9fb7c86e25c0f423bea57b977111;p=vchess.git diff --git a/public/javascripts/variants/Checkered.js b/public/javascripts/variants/Checkered.js index 4a9419a8..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; } @@ -299,5 +299,3 @@ class CheckeredRules extends ChessRules } } } - -const VariantRules = CheckeredRules;