X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPacifist1.js;h=37d0521f1b8657dd2f016c47ba9b675044bf4ceb;hp=43c81d719b33a5bbcb43bea35e4d2ac690ca065f;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hpb=31c535953c843b28434a7fcdf7b4da0b376774ab diff --git a/client/src/variants/Pacifist1.js b/client/src/variants/Pacifist1.js index 43c81d71..37d0521f 100644 --- a/client/src/variants/Pacifist1.js +++ b/client/src/variants/Pacifist1.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class Pacifist1Rules extends ChessRules { + static get PawnSpecs() { return Object.assign( {}, @@ -36,30 +37,8 @@ export class Pacifist1Rules extends ChessRules { return true; } - scanKings(fen) { - // Kings may be swapped, so they are not tracked (no kingPos) - this.INIT_COL_KING = { w: -1, b: -1 }; - const fenRows = V.ParseFen(fen).position.split("/"); - const startRow = { 'w': V.size.x - 1, 'b': 0 }; - for (let i = 0; i < fenRows.length; i++) { - let k = 0; //column index on board - for (let j = 0; j < fenRows[i].length; j++) { - switch (fenRows[i].charAt(j)) { - case "k": - this.INIT_COL_KING["b"] = k; - break; - case "K": - this.INIT_COL_KING["w"] = k; - break; - default: { - const num = parseInt(fenRows[i].charAt(j), 10); - if (!isNaN(num)) k += num - 1; - } - } - k++; - } - } - } + // Kings may be swapped, so they are not tracked (no kingPos) + scanKings(fen) { } // Sum white pieces attacking a square, and remove black pieces count. sumAttacks([x, y]) { @@ -260,4 +239,5 @@ export class Pacifist1Rules extends ChessRules { static get SEARCH_DEPTH() { return 1; } + };