Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Racingkings.js
index 21d5c85..745843b 100644 (file)
@@ -1,6 +1,11 @@
 import { ChessRules } from "@/base_rules";
 
-export const VariantRules = class RacingkingsRules extends ChessRules {
+export class RacingkingsRules extends ChessRules {
+
+  static get Options() {
+    return null;
+  }
+
   static get HasFlags() {
     return false;
   }
@@ -44,7 +49,8 @@ export const VariantRules = class RacingkingsRules extends ChessRules {
       // at next move, then it should be a draw:
       if (color == "w" && this.kingPos['b'][0] == 1) {
         // Search for a move
-        const oppKingMoves = this.getPotentialKingMoves(this.kingPos['b']);
+        const oppKingMoves = this.filterValid(
+          this.getPotentialKingMoves(this.kingPos['b']));
         if (oppKingMoves.some(m => m.end.x == 0)) return "*";
       }
       return color == "w" ? "1-0" : "0-1";
@@ -60,4 +66,5 @@ export const VariantRules = class RacingkingsRules extends ChessRules {
     // Ponder with king position:
     return evaluation/5 + this.kingPos["b"][0] - this.kingPos["w"][0];
   }
+
 };