Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Apocalypse.js
index 2439ae5..fc30915 100644 (file)
@@ -2,6 +2,11 @@ import { ChessRules } from "@/base_rules";
 import { randInt } from "@/utils/alea";
 
 export class ApocalypseRules extends ChessRules {
+
+  static get Options() {
+    return null;
+  }
+
   static get PawnSpecs() {
     return Object.assign(
       {},
@@ -55,7 +60,7 @@ export class ApocalypseRules extends ChessRules {
         if (['P','p'].includes(row[i])) pawns[row[i]]++;
         if (V.PIECES.includes(row[i].toLowerCase())) sumElts++;
         else {
-          const num = parseInt(row[i]);
+          const num = parseInt(row[i], 10);
           if (isNaN(num)) return false;
           sumElts += num;
         }
@@ -139,8 +144,8 @@ export class ApocalypseRules extends ChessRules {
 
   setFlags(fenflags) {
     this.penaltyFlags = {
-      'w': parseInt(fenflags[0]),
-      'b': parseInt(fenflags[1])
+      'w': parseInt(fenflags[0], 10),
+      'b': parseInt(fenflags[1], 10)
     };
   }
 
@@ -512,4 +517,5 @@ export class ApocalypseRules extends ChessRules {
       V.CoordsToSquare(move.end)
     );
   }
+
 };