From: Benjamin Auder Date: Thu, 30 Jan 2025 17:26:19 +0000 (+0100) Subject: update X-Git-Url: https://git.auder.net/game/doc/html/$%7BgetWhatsApp(link)%7D?a=commitdiff_plain;ds=sidebyside;p=xogo.git update --- diff --git a/base_rules.js b/base_rules.js index 3d8e463..888fdcf 100644 --- a/base_rules.js +++ b/base_rules.js @@ -2235,8 +2235,7 @@ export default class ChessRules { // 'color' arg because some variants (e.g. Refusal) check opponent moves filterValid(moves, color) { - if (!color) - color = this.turn; + color = color || this.turn; const oppCols = this.getOppCols(color); let kingPos = this.searchKingPos(color); return moves.filter(m => { diff --git a/variants/Dynamo/class.js b/variants/Dynamo/class.js index 7b835e0..d726522 100644 --- a/variants/Dynamo/class.js +++ b/variants/Dynamo/class.js @@ -181,8 +181,8 @@ export default class DynamoRules extends ChessRules { // NOTE: for pushes, play the pushed piece first. // for pulls: play the piece doing the action first // NOTE: to push a piece out of the board, make it slide until its king - getPotentialMovesFrom([x, y]) { - const color = this.turn; + getPotentialMovesFrom([x, y], color) { + const color = color || this.turn; const sqCol = this.getColor(x, y); const pawnShift = (color == 'w' ? -1 : 1); const pawnStartRank = (color == 'w' ? 6 : 1); @@ -486,6 +486,10 @@ export default class DynamoRules extends ChessRules { return []; } + getAllPotentialMoves(color) { + + } + getSlideNJumpMoves([x, y], steps, oneStep) { let moves = []; const c = this.getColor(x, y);