From: Benjamin Auder Date: Sat, 22 Oct 2022 06:26:12 +0000 (+0200) Subject: Fix FenUtil X-Git-Url: https://git.auder.net/?p=xogo.git;a=commitdiff_plain;h=0cef7bb4f72046ce60db408bfb76103428e2c15a Fix FenUtil --- diff --git a/utils/setupPieces.js b/utils/setupPieces.js index 7cd6779..11af74a 100644 --- a/utils/setupPieces.js +++ b/utils/setupPieces.js @@ -1,10 +1,10 @@ import {Random} from "/utils/alea.js"; -export class FenUtil = { +export const FenUtil = { // arg o (constraints): "between" with p1 and p2. // "flags", "diffCol": array of pieceType - setupRow(arr, o) { + setupRow: function(arr, o) { let res = JSON.parse(JSON.stringify(arr)); if (o.randomness >= 1) res = Random.shuffle(arr); @@ -51,9 +51,9 @@ export class FenUtil = { } } return {fen: res, flags: flags}; - } + }, - setupPieces(arr, o) { + setupPieces: function(arr, o) { const row1 = FenUtil.setupRow(arr, o); const row2 = o.randomness == 2 ? FenUtil.setupRow(arr, o) : row1; return { diff --git a/variants/_Antiking/class.js b/variants/_Antiking/class.js index ac9aedc..771726c 100644 --- a/variants/_Antiking/class.js +++ b/variants/_Antiking/class.js @@ -38,7 +38,7 @@ export default class AbstractAntikingRules extends ChessRules { } // NOTE: canTake includes (wrong) captures of antiking, - // to not go to low-level using findDestSquares() + // to detect attacks on antikings. canTake([x1, y1], [x2, y2]) { const piece1 = this.getPiece(x1, y1); const color1 = this.getColor(x1, y1);