X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FKoth.js;h=42ffe7bbfa08169b5f7e943725acab302311326e;hp=e286862d9c360b8e8505a9ff1e1d4be4b5b5cbe6;hb=107dc1bd5361e2538b1551bdcc37c1e90a444b83;hpb=236485b53993f2adfd588022e2899a39491fc825 diff --git a/client/src/variants/Koth.js b/client/src/variants/Koth.js index e286862d..42ffe7bb 100644 --- a/client/src/variants/Koth.js +++ b/client/src/variants/Koth.js @@ -1,17 +1,13 @@ import { ChessRules } from "@/base_rules"; export class KothRules extends ChessRules { - filterValid(moves) { - if (moves.length == 0) return []; - const color = this.turn; - const oppCol = V.GetOppCol(color); - return moves.filter(m => { - this.play(m); - // Giving check is forbidden as well: - const res = !this.underCheck(color) && !this.underCheck(oppCol); - this.undo(m); - return res; - }); + static get Lines() { + return [ + [[3, 3], [3, 5]], + [[3, 3], [5, 3]], + [[3, 5], [5, 5]], + [[5, 3], [5, 5]] + ]; } getCurrentScore() { @@ -24,9 +20,7 @@ export class KothRules extends ChessRules { // The middle is reached! return color == "w" ? "1-0" : "0-1"; } - if (this.atLeastOneMove()) return "*"; - // Stalemate (will probably never happen) - return "1/2"; + return super.getCurrentScore(); } evalPosition() {