X-Git-Url: https://git.auder.net/images/pieces/Cwda/bh.svg?a=blobdiff_plain;f=variants%2FAtomic%2Fclass.js;h=924d2226e640224a60fa1b848227cea851c3e234;hb=639afc982f9c3be3b4748ef10e8ef771a295712f;hp=7cac4e5b4db2d7767a972843ee90147b063e2620;hpb=3a77a0b4c3ba2f767a81ef688ae6aa70b95250be;p=xogo.git diff --git a/variants/Atomic/class.js b/variants/Atomic/class.js index 7cac4e5..924d222 100644 --- a/variants/Atomic/class.js +++ b/variants/Atomic/class.js @@ -24,28 +24,13 @@ export default class AtomicRules extends ChessRules { } constructor(o) { + o.options["atomic"] = true; super(o); - this.options.atomic = true; - } - - genRandInitFen(seed) { - return super.genRandInitFen(seed).slice(0, -1) + ',"rempawn":' + (this.options.rempawn ? "1" : "0") + "}"; - } - - // TODO: capture king option doesn't make sense - - setOtherVariables(fenParsed) { - super.setOtherVariables(fenParsed); - this.options["rempawn"] = (fenParsed.rempawn == 1); - } - - getFen() { - return super.getFen().slice(0, -1) + ',"rempawn":' + (this.options["rempawn"] ? "1" : "0") + "}"; } canIplay(x, y) { if (this.options["rempawn"] && this.movesCount == 0) - return (this.turn == side && this.getPiece(x, y) == "p"); + return (this.playerColor == this.turn && this.getPiece(x, y) == "p"); return super.canIplay(x, y); }