X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRugby.js;h=64c9942628970981ec0603fd554659dd57b928cb;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=209def87b95c969c9539bbd4e2f18aaa52c55dbd;hpb=6f2f94374f1e73c375edf732d9425e575e81fff7;p=vchess.git diff --git a/client/src/variants/Rugby.js b/client/src/variants/Rugby.js index 209def87..64c99426 100644 --- a/client/src/variants/Rugby.js +++ b/client/src/variants/Rugby.js @@ -2,6 +2,11 @@ import { ChessRules } from "@/base_rules"; import { ArrayFun } from "@/utils/array"; export class RugbyRules extends ChessRules { + + static get Options() { + return null; + } + static get HasFlags() { return false; } @@ -28,7 +33,7 @@ export class RugbyRules extends ChessRules { this.turn == 'w' ? [ [-1,-1], [-1,1], [0,1], [0,-1], [1,-1], [1,0], [1,1] ] : [ [1,-1], [1,1], [0,1], [0,-1], [-1,-1], [-1,0], [-1,1] ]; - let addMoves = this.getSlideNJumpMoves(sq, steps, "oneStep"); + let addMoves = this.getSlideNJumpMoves(sq, steps, 1); return moves.concat(addMoves.filter(m => m.vanish.length == 1)); } @@ -61,4 +66,9 @@ export class RugbyRules extends ChessRules { // Stalemate (will probably never happen) return "1/2"; } + + getNotation(move) { + return V.CoordsToSquare(move.start) + V.CoordsToSquare(move.end); + } + };