X-Git-Url: https://git.auder.net/%3C?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fbase_rules.js;h=da9fab7837622a1dc3fc46ce452da10538d88c66;hb=1cd3e362caa05b60f01cf8b1d4f6bfeafc0be55f;hp=85f63a2a8d6e3837647a4e99bfe06de110bae852;hpb=a13cbc0f2c8cf46c0584118a11af9e3cd6bbdcb9;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 85f63a2a..da9fab78 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -46,12 +46,19 @@ export const ChessRules = class ChessRules { static get CanAnalyze() { return true; } + // Patch: issues with javascript OOP, objects can't access static fields. + get canAnalyze() { + return V.CanAnalyze; + } // Some variants show incomplete information, // and thus show only a partial moves list or no list at all. static get ShowMoves() { return "all"; } + get showMoves() { + return V.ShowMoves; + } // Turn "wb" into "B" (for FEN) static board2fen(b) { @@ -1254,7 +1261,7 @@ export const ChessRules = class ChessRules { // TODO: un-ambiguous notation (switch on piece type, check directions...) getNotation(move) { if (move.appear.length == 2 && move.appear[0].p == V.KING) - //castle + // Castle return move.end.y < move.start.y ? "0-0-0" : "0-0"; // Translate final square