X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHorde.js;h=a54b50924519fe148ca056804058e64d5785963c;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=c436811b0f457fb7e26fab88b44d1ecfc0adf607;hpb=e50a802531b99829c533f22ecd21e359e7e1e049;p=vchess.git diff --git a/client/src/variants/Horde.js b/client/src/variants/Horde.js index c436811b..a54b5092 100644 --- a/client/src/variants/Horde.js +++ b/client/src/variants/Horde.js @@ -1,6 +1,19 @@ import { ChessRules } from "@/base_rules"; export class HordeRules extends ChessRules { + + static get Options() { + return { + check: [ + { + label: "Random", + defaut: false, + variable: "random" + } + ] + }; + } + static get HasFlags() { return false; } @@ -35,9 +48,9 @@ export class HordeRules extends ChessRules { return true; } - static GenRandInitFen(randomness) { - if (randomness == 2) randomness--; - const fen = ChessRules.GenRandInitFen(randomness); + static GenRandInitFen(options) { + const fen = + ChessRules.GenRandInitFen({ randomness: (options.random ? 1 : 0) }); return ( // 20 first chars are 3 rows + 3 slashes fen.substr(0, 20) @@ -80,4 +93,5 @@ export class HordeRules extends ChessRules { // From black side, just run usual checks: return super.getCurrentScore(); } + };