X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FGrasshopper.js;h=fb8c27cda7e5efee0ffb401d8dad06915b28a9e3;hp=ec52d9b3f635c1a619fd0bd87109e865344a56dd;hb=32f6285ee325a14286562a53baefc647201df2af;hpb=11482348f50058d235adb89bfc174a1da7c6abc4 diff --git a/client/src/variants/Grasshopper.js b/client/src/variants/Grasshopper.js index ec52d9b3..fb8c27cd 100644 --- a/client/src/variants/Grasshopper.js +++ b/client/src/variants/Grasshopper.js @@ -2,11 +2,22 @@ import { ChessRules } from "@/base_rules"; import { ArrayFun } from "@/utils/array"; import { randInt } from "@/utils/alea"; -export const VariantRules = class GrasshopperRules extends ChessRules { +export class GrasshopperRules extends ChessRules { static get HasEnpassant() { return false; } + static get PawnSpecs() { + return Object.assign( + {}, + ChessRules.PawnSpecs, + { + twoSquares: false, + promotions: ChessRules.PawnSpecs.promotions.concat([V.GRASSHOPPER]) + } + ); + } + static get GRASSHOPPER() { return "g"; }