X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FKnightrelay2.js;h=a8a796e856f9315982661d12ce6ae25d64ade0ae;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=9fa5dcca87fa19324396b67f265084cca6205e01;hpb=68e19a449db7a12e0a168e99cd750d985c983ba1;p=vchess.git diff --git a/client/src/variants/Knightrelay2.js b/client/src/variants/Knightrelay2.js index 9fa5dcca..a8a796e8 100644 --- a/client/src/variants/Knightrelay2.js +++ b/client/src/variants/Knightrelay2.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; -export const VariantRules = class Knightrelay2Rules extends ChessRules { +export class Knightrelay2Rules extends ChessRules { + getPotentialMovesFrom([x, y]) { let moves = super.getPotentialMovesFrom([x, y]); @@ -101,7 +102,8 @@ export const VariantRules = class Knightrelay2Rules extends ChessRules { const finalSquare = V.CoordsToSquare(move.end); const piece = this.getPiece(move.start.x, move.start.y); - // Since pieces and pawns could move like knight, indicate start and end squares + // Since pieces and pawns could move like knight, + // indicate start and end squares let notation = piece.toUpperCase() + initSquare + @@ -119,4 +121,5 @@ export const VariantRules = class Knightrelay2Rules extends ChessRules { return notation; } + };