X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FDoublearmy.js;h=87d262a62ee98d00353e136b3753a794b1728138;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=1846aa3cfa3c7bae652f8e176b2f9b293eba2a6d;hpb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;p=vchess.git diff --git a/client/src/variants/Doublearmy.js b/client/src/variants/Doublearmy.js index 1846aa3c..87d262a6 100644 --- a/client/src/variants/Doublearmy.js +++ b/client/src/variants/Doublearmy.js @@ -3,7 +3,7 @@ import { ChessRules } from "@/base_rules"; // Ideas with 2 kings: // Stage 1 {w, b} : 2 kings on board, value 5. // Stage 2: only one, get mated and all that, value 1000 -// ...But the middle king will get captured quickly... +// ...But the middle king will be captured quickly... export class DoublearmyRules extends ChessRules { @@ -19,8 +19,8 @@ export class DoublearmyRules extends ChessRules { return (b[1] == V.COMMONER ? "Doublearmy/" : "") + b; } - static GenRandInitFen(randomness) { - const fen = ChessRules.GenRandInitFen(randomness); + static GenRandInitFen(options) { + const fen = ChessRules.GenRandInitFen(options); const rows = fen.split(" ")[0].split("/"); return ( rows[0] + "/" + @@ -45,10 +45,7 @@ export class DoublearmyRules extends ChessRules { getPotentialCommonerMoves(sq) { return this.getSlideNJumpMoves( - sq, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } isAttacked(sq, color) { @@ -60,19 +57,13 @@ export class DoublearmyRules extends ChessRules { isAttackedByCommoner(sq, color) { return this.isAttackedBySlideNJump( - sq, - color, - V.COMMONER, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), - "oneStep" - ); + sq, color, V.COMMONER, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), 1); } static get VALUES() { return Object.assign( - {}, - ChessRules.VALUES, - { c: 5 } + { c: 5 }, + ChessRules.VALUES ); }