X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FFootball.js;h=7829c2d6e67673b65cdcd98821db4cd58e0d9654;hp=d63cfee3ac33d84dda458bb5679e2eb918096208;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Football.js b/client/src/variants/Football.js index d63cfee3..7829c2d6 100644 --- a/client/src/variants/Football.js +++ b/client/src/variants/Football.js @@ -104,13 +104,13 @@ export class FootballRules extends ChessRules { } } - static GenRandInitFen(randomness) { - if (randomness == 0) + static GenRandInitFen(options) { + if (options.randomness == 0) return "rnbq1knbr/9/9/9/4a4/9/9/9/RNBQ1KNBR w 0"; let pieces = { w: new Array(8), b: new Array(8) }; for (let c of ["w", "b"]) { - if (c == 'b' && randomness == 1) { + if (c == 'b' && options.randomness == 1) { pieces['b'] = pieces['w']; break; } @@ -314,22 +314,8 @@ export class FootballRules extends ChessRules { return moves; } - // No captures: - getSlideNJumpMoves([x, y], steps, oneStep) { - let moves = []; - outerLoop: for (let step of steps) { - let i = x + step[0]; - let j = y + step[1]; - let stepCount = 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]; - stepCount++; - } - } - return moves; + canTake() { + return false; } // Extra arg "computer" to avoid trimming all redundant pass moves: