Add Brotherhood, Maharajah (special version) + Dobutsu variants
[vchess.git] / client / src / variants / Shogi.js
index 6c522dc..63c0d72 100644 (file)
@@ -3,6 +3,7 @@ import { ArrayFun } from "@/utils/array";
 import { sample, shuffle } from "@/utils/alea";
 
 export class ShogiRules extends ChessRules {
+
   static get HasFlags() {
     return false;
   }
@@ -307,7 +308,7 @@ export class ShogiRules extends ChessRules {
       case V.LANCE:
         return this.getPotentialLanceMoves([x, y]);
       case V.KING:
-        return this.getPotentialKingMoves([x, y]);
+        return super.getPotentialKingMoves([x, y]);
       case V.P_ROOK:
         return this.getPotentialDragonMoves([x, y]);
       case V.P_BISHOP:
@@ -446,14 +447,6 @@ export class ShogiRules extends ChessRules {
     );
   }
 
-  getPotentialKingMoves(sq) {
-    return this.getSlideNJumpMoves(
-      sq,
-      V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
-      { oneStep: true }
-    );
-  }
-
   isAttacked(sq, color) {
     return (
       this.isAttackedByPawn(sq, color) ||
@@ -656,4 +649,5 @@ export class ShogiRules extends ChessRules {
       )
     );
   }
+
 };