X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=7949d7f605d3856c07db605471d5245bca395481;hb=241bf8f2a9a2c48d793aeb0b1d20207f6371de70;hp=7e4057bbe6b78f0266d4885fccbdef85fc2f3520;hpb=78d64531113d4b5045ff588dd43f301a332ebae8;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 7e4057bb..7949d7f6 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -53,11 +53,6 @@ export const ChessRules = class ChessRules { return "all"; } - // Path to pieces - static getPpath(b) { - return b; //usual pieces in pieces/ folder - } - // Turn "wb" into "B" (for FEN) static board2fen(b) { return b[0] == "w" ? b[1].toUpperCase() : b[1]; @@ -160,6 +155,11 @@ export const ChessRules = class ChessRules { return V.CoordToColumn(coords.y) + (V.size.x - coords.x); } + // Path to pieces + getPpath(b) { + return b; //usual pieces in pieces/ folder + } + // Aggregates flags into one object aggregateFlags() { return this.castleFlags; @@ -379,7 +379,9 @@ export const ChessRules = class ChessRules { // INITIALIZATION constructor(fen) { - this.re_init(fen); + // In printDiagram() fen isn't supply because only getPpath() is used + if (fen) + this.re_init(fen); } // Fen string fully describes the game state