X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAtomic.js;h=90089e8b063f2d9fb5d9f8cf4b2d754ee77e80fa;hb=0d5335de5c94d780e03ac0aa3279b731c69455cc;hp=19521c2d3c57f774361064dd7a15cc28d9051d64;hpb=68e19a449db7a12e0a168e99cd750d985c983ba1;p=vchess.git diff --git a/client/src/variants/Atomic.js b/client/src/variants/Atomic.js index 19521c2d..90089e8b 100644 --- a/client/src/variants/Atomic.js +++ b/client/src/variants/Atomic.js @@ -1,13 +1,6 @@ import { ChessRules, PiPo } from "@/base_rules"; -export const VariantRules = class AtomicRules extends ChessRules { - getEpSquare(moveOrSquare) { - if (typeof moveOrSquare !== "object" || moveOrSquare.appear.length > 0) - return super.getEpSquare(moveOrSquare); - // Capturing move: no en-passant - return undefined; - } - +export class AtomicRules extends ChessRules { getPotentialMovesFrom([x, y]) { let moves = super.getPotentialMovesFrom([x, y]); @@ -151,8 +144,7 @@ export const VariantRules = class AtomicRules extends ChessRules { if (kp[0] < 0) // King disappeared return color == "w" ? "0-1" : "1-0"; - if (this.atLeastOneMove()) - return "*"; + if (this.atLeastOneMove()) return "*"; if (!this.isAttacked(kp, V.GetOppCol(color))) return "1/2"; return color == "w" ? "0-1" : "1-0"; //checkmate }