X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FDice.js;h=9c35204033469853b48bbd9176ed679107f01e21;hb=8a7741563d38babbebd17ee83c0362a7bc98e9f6;hp=682b8d5071e714564791791f92a9a71ac5f0bda6;hpb=c98f15e70fdf7c20ae4f17b54fee8a5736c7ce13;p=vchess.git diff --git a/client/src/variants/Dice.js b/client/src/variants/Dice.js index 682b8d50..9c352040 100644 --- a/client/src/variants/Dice.js +++ b/client/src/variants/Dice.js @@ -2,6 +2,24 @@ import { ChessRules, Move } from "@/base_rules"; import { randInt } from "@/utils/alea"; export class DiceRules extends ChessRules { + + static get Options() { + return { + select: [ + { + label: "Randomness", + variable: "randomness", + defaut: 2, + options: [ + { label: "Deterministic", value: 0 }, + { label: "Symmetric random", value: 1 }, + { label: "Asymmetric random", value: 2 } + ] + } + ] + }; + } + static get CanAnalyze() { return false; } @@ -34,8 +52,8 @@ export class DiceRules extends ChessRules { return (L > 0 ? this.p2play[L-1] : "-"); } - static GenRandInitFen(randomness) { - return ChessRules.GenRandInitFen(randomness) + " -"; + static GenRandInitFen(options) { + return ChessRules.GenRandInitFen(options) + " -"; } canMove(piece, color, [x, y]) { @@ -177,4 +195,5 @@ export class DiceRules extends ChessRules { getNotation(move) { return super.getNotation(move) + "/" + move.end.p.toUpperCase(); } + };