X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FAlice.js;h=f7d2fa13422b189e3258bb6a923c8545d582184f;hb=643479f8d7c3622b57fc49c4f10d9950793ebf4f;hp=5e10a059f36a0bd185ce7770fd272fef2e62d093;hpb=0b7d99ecbb5dedc02cd96c457b5fc2962db9b297;p=vchess.git diff --git a/public/javascripts/variants/Alice.js b/public/javascripts/variants/Alice.js index 5e10a059..f7d2fa13 100644 --- a/public/javascripts/variants/Alice.js +++ b/public/javascripts/variants/Alice.js @@ -29,20 +29,24 @@ class AliceRules extends ChessRules return (Object.keys(this.ALICE_PIECES).includes(b[1]) ? "Alice/" : "") + b; } - initVariables(fen) + static get PIECES() { - super.initVariables(fen); - const fenParts = fen.split(" "); - const position = fenParts[0].split("/"); + return ChessRules.PIECES.concat(Object.keys(V.ALICE_PIECES)); + } + + setOtherVariables(fen) + { + super.setOtherVariables(fen); + const rows = V.ParseFen(fen).position.split("/"); if (this.kingPos["w"][0] < 0 || this.kingPos["b"][0] < 0) { - // INIT_COL_XXX won't be used, so no need to set them for Alice kings - for (let i=0; i move.appear.length ? "x" : ""); let pawnMark = ""; if (["p","s"].includes(piece) && captureMark.length == 1) - pawnMark = String.fromCharCode(97 + move.start.y); //start column + pawnMark = V.GetColumn(move.start.y); //start column // Piece or pawn movement let notation = piece.toUpperCase() + pawnMark + captureMark + finalSquare; @@ -331,3 +336,5 @@ class AliceRules extends ChessRules return notation; } } + +const VariantRules = AliceRules;