X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=5584fb870aa6f2239248d580fa0f2e45945ca1f3;hb=HEAD;hp=039aaeaf93b2f7b72a51876be811e7e4ca5103f7;hpb=a930dd712643df1d673bdc2b777b5912b9a41584;p=vchess.git diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index 039aaeaf..5584fb87 100644 --- a/client/src/variants/Benedict.js +++ b/client/src/variants/Benedict.js @@ -1,6 +1,7 @@ import { ChessRules, PiPo, Move } from "@/base_rules"; export class BenedictRules extends ChessRules { + static get HasEnpassant() { return false; } @@ -13,22 +14,8 @@ export class BenedictRules extends ChessRules { ); } - // TODO(?): some duplicated code in 2 next functions - getSlideNJumpMoves([x, y], steps, oneStep) { - let moves = []; - outerLoop: for (let loop = 0; loop < steps.length; loop++) { - const step = steps[loop]; - let i = x + step[0]; - let j = y + step[1]; - while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) { - moves.push(this.getBasicMove([x, y], [i, j])); - if (oneStep) continue outerLoop; - i += step[0]; - j += step[1]; - } - // No capture check: handled elsewhere (next method) - } - return moves; + canTake() { + return false; } // Find possible captures from a square @@ -166,4 +153,5 @@ export class BenedictRules extends ChessRules { }; return super.getNotation(basicMove); } + };