Several small improvements + integrate options + first working draft of Cwda
[vchess.git] / client / src / variants / Yote.js
index 76d7c2e..6863026 100644 (file)
@@ -3,6 +3,10 @@ import { randInt } from "@/utils/alea";
 
 export class YoteRules extends ChessRules {
 
+  static get Options() {
+    return null;
+  }
+
   static get HasFlags() {
     return false;
   }
@@ -72,7 +76,7 @@ export class YoteRules extends ChessRules {
     );
   }
 
-  static GenRandInitFen(randomness) {
+  static GenRandInitFen() {
     return "6/6/6/6/6 w 0 12,12 -,-";
   }
 
@@ -167,8 +171,8 @@ export class YoteRules extends ChessRules {
     return (x < V.size.x && this.getColor(x, y) != side);
   }
 
-  // TODO: hoverHighlight() would well take an arg "side"...
-  hoverHighlight(x, y) {
+  hoverHighlight([x, y], side) {
+    if (!!side && side != this.turn) return false;
     const L = this.captures.length;
     if (!this.captures[L-1]) return false;
     const oppCol = V.GetOppCol(this.turn);
@@ -242,7 +246,7 @@ export class YoteRules extends ChessRules {
       const mv = this.doClick([x, y]);
       return (!!mv ? [mv] : []);
     }
-    if (x >= V.size.x) return this.getReserveMoves([x, y]);
+    if (x >= V.size.x) return this.getReserveMoves(x);
     return this.getPotentialPawnMoves([x, y]);
   }