X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FAtomic%2Fclass.js;h=5c73de22b96982801774a40dbcd08f6824a4f344;hb=8f57fbf250093488064401d503f1c621b122e95a;hp=ad2e9a14da4c1454445327507ac6170afef02e39;hpb=6f74b81a893da23181f30e2ef1e68bde8a5476cd;p=xogo.git diff --git a/variants/Atomic/class.js b/variants/Atomic/class.js index ad2e9a1..5c73de2 100644 --- a/variants/Atomic/class.js +++ b/variants/Atomic/class.js @@ -7,30 +7,26 @@ export default class AtomicRules extends ChessRules { static get Options() { return { select: C.Options.select, - check: [ + input: [ { label: "Balanced", - defaut: false, - variable: "rempawn" - }, - { - label: "Falling pawn", - defaut: false, - variable: "pawnfall" + variable: "rempawn", + type: "checkbox", + defaut: false } - ], + ].concat(C.Options.input.filter(i => i.variable == "pawnfall")), styles: C.Options.styles.filter(s => s != "atomic") }; } constructor(o) { + o.options["atomic"] = true; super(o); - this.options["atomic"] = true; } 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); }