Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Grasshopper.js
index 5069e23..fcc6bb1 100644 (file)
@@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array";
 import { randInt } from "@/utils/alea";
 
 export class GrasshopperRules extends ChessRules {
+
   static get HasEnpassant() {
     return false;
   }
@@ -11,10 +12,7 @@ export class GrasshopperRules extends ChessRules {
     return Object.assign(
       {},
       ChessRules.PawnSpecs,
-      {
-        twoSquares: false,
-        promotions: ChessRules.PawnSpecs.promotions.concat([V.GRASSHOPPER])
-      }
+      { promotions: ChessRules.PawnSpecs.promotions.concat([V.GRASSHOPPER]) }
     );
   }
 
@@ -103,12 +101,13 @@ export class GrasshopperRules extends ChessRules {
     return 2;
   }
 
-  static GenRandInitFen(randomness) {
-    return ChessRules.GenRandInitFen(randomness)
+  static GenRandInitFen(options) {
+    return ChessRules.GenRandInitFen(options)
       .slice(0, -2)
       .replace(
         "/pppppppp/8/8/8/8/PPPPPPPP/",
         "/gggggggg/pppppppp/8/8/PPPPPPPP/GGGGGGGG/"
       );
   }
+
 };