{
var i = x + step[0];
var j = y + step[1];
- while (i>=0 && i<sizeX && j>=0 && j<sizeY
- && this.board[i][j] == VariantRules.EMPTY)
+ while (i>=0 && i<sizeX && j>=0 && j<sizeY && this.board[i][j] == VariantRules.EMPTY)
{
moves.push(this.getBasicMove(x, y, i, j));
if (oneStep !== undefined)
static get ANTIKING() { return 'a'; }
- // TODO: more subtle than that, require changing args: wp, bk and not just colors
- canTake(color1, color2)
+ canTake(color1, color2, [x,y])
{
- return color1 != color2;
+ const piece = this.getPiece(x,y);
+ return (piece != "a" && color1 != color2) || (piece == "a" && color1 == color2);
}
getPotentialMovesFrom([x,y])
}
}
+// TODO: generaliser (à moindre coût) base_rules ? Ou spécialiser variantes ?
+
getPotentialAntikingMoves(x, y, c)
{
// TODO