X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRugby.js;h=64c9942628970981ec0603fd554659dd57b928cb;hb=HEAD;hp=04306c265460fd25cd5be3977b4bffda9bbd0aca;hpb=7769191167d394c3b52625dae62b4af93803d656;p=vchess.git diff --git a/client/src/variants/Rugby.js b/client/src/variants/Rugby.js index 04306c26..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; } @@ -14,6 +19,8 @@ export class RugbyRules extends ChessRules { ); } + scanKings() {} + getPotentialMovesFrom(sq) { // There are only pawns: return this.getPotentialPawnMoves(sq); @@ -26,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)); } @@ -44,6 +51,10 @@ export class RugbyRules extends ChessRules { preUndo() {} postUndo() {} + getCheckSquares() { + return []; + } + getCurrentScore() { // Turn has changed: const color = V.GetOppCol(this.turn); @@ -55,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); + } + };