X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHidden.js;h=79c3dfbdd2c29aefba4933f315271188f6b413e3;hp=046fe99e02d55fcc68931d3bff6639bd02b88750;hb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;hpb=afbf3ca7151ef15a9e579b0f913683ab212396c4 diff --git a/client/src/variants/Hidden.js b/client/src/variants/Hidden.js index 046fe99e..79c3dfbd 100644 --- a/client/src/variants/Hidden.js +++ b/client/src/variants/Hidden.js @@ -74,7 +74,7 @@ export const VariantRules = class HiddenRules extends ChessRules { } // Scan board for kings positions (no castling) - scanKingsRooks(fen) { + scanKings(fen) { this.kingPos = { w: [-1, -1], b: [-1, -1] }; const fenRows = V.ParseFen(fen).position.split("/"); for (let i = 0; i < fenRows.length; i++) { @@ -225,8 +225,8 @@ export const VariantRules = class HiddenRules extends ChessRules { return []; } - updateVariables(move) { - super.updateVariables(move); + postPlay(move) { + super.postPlay(move); if ( move.vanish.length >= 2 && [V.KING,V.HIDDEN_CODE[V.KING]].includes(move.vanish[1].p) @@ -236,8 +236,8 @@ export const VariantRules = class HiddenRules extends ChessRules { } } - unupdateVariables(move) { - super.unupdateVariables(move); + postUndo(move) { + super.postUndo(move); const c = move.vanish[0].c; const oppCol = V.GetOppCol(c); if (this.kingPos[oppCol][0] < 0)