From: Benjamin Auder Date: Thu, 3 Jun 2021 23:28:46 +0000 (+0200) Subject: loseOnRepetition: getter seems enough X-Git-Url: https://git.auder.net/game/scripts/%7B%7B%20asset%28%27mixstore/doc/html/left.jpg?a=commitdiff_plain;h=e30523f27d5989903de6743a8b4f194a390d576c;p=vchess.git loseOnRepetition: getter seems enough --- diff --git a/client/src/variants/Pandemonium2.js b/client/src/variants/Pandemonium2.js index 4a980832..2af56ea5 100644 --- a/client/src/variants/Pandemonium2.js +++ b/client/src/variants/Pandemonium2.js @@ -12,7 +12,7 @@ export class Pandemonium2Rules extends ChessRules { ); } - loseOnRepetition() { + get loseOnRepetition() { // If current side is under check: lost return this.underCheck(this.turn); } diff --git a/client/src/variants/Shogi.js b/client/src/variants/Shogi.js index 9806351c..95be2d1b 100644 --- a/client/src/variants/Shogi.js +++ b/client/src/variants/Shogi.js @@ -24,7 +24,7 @@ export class ShogiRules extends ChessRules { return true; } - loseOnRepetition() { + get loseOnRepetition() { // If current side is under check: lost return this.underCheck(this.turn); } diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 1071ece8..11a59258 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -1447,7 +1447,7 @@ export default { ? this.repeat[fenObj] + 1 : 1; if (this.repeat[fenObj] >= 3) { - if (this.vr.loseOnRepetition()) + if (this.vr.loseOnRepetition) this.gameOver(moveCol == "w" ? "0-1" : "1-0", "Repetition"); else this.drawOffer = "threerep"; }