X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FZen.js;h=da4dd7af60454924f155a175ed5134c194220c37;hb=2d7194bd9c976f444e43e5dc0a725823b6472eb9;hp=64587d204b9cdf3412789aaa6476a0d75aa4ca2a;hpb=1a788978e3682ab54b77af3edfe38e0b371edbc4;p=vchess.git diff --git a/public/javascripts/variants/Zen.js b/public/javascripts/variants/Zen.js index 64587d20..da4dd7af 100644 --- a/public/javascripts/variants/Zen.js +++ b/public/javascripts/variants/Zen.js @@ -1,10 +1,7 @@ class ZenRules extends ChessRules { // NOTE: enPassant, if enabled, would need to redefine carefully getEpSquare - getEpSquare(move) - { - return undefined; - } + static get HasEnpassant { return false; } // TODO(?): some duplicated code in 2 next functions getSlideNJumpMoves([x,y], steps, oneStep) @@ -184,12 +181,10 @@ class ZenRules extends ChessRules } // Translate initial square (because pieces may fly unusually in this variant!) - const initialSquare = - String.fromCharCode(97 + move.start.y) + (V.size.x-move.start.x); + const initialSquare = V.CoordsToSquare(move.start); // Translate final square - const finalSquare = - String.fromCharCode(97 + move.end.y) + (V.size.x-move.end.x); + const finalSquare = V.CoordsToSquare(move.end); let notation = ""; const piece = this.getPiece(move.start.x, move.start.y); @@ -218,7 +213,9 @@ class ZenRules extends ChessRules return notation; } - static get VALUES() { //TODO: experimental + static get VALUES() + { + // TODO: experimental return { 'p': 1, 'r': 3,