X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHidden.js;h=c79267a56ac40e795de4dfb780bf66990ba3a42f;hp=96822b937e84990d667b6822c61b6feb098181b0;hb=e71161fbfffe53b0f4b174e0467cdd98cc70b7b0;hpb=1c5bfdf23707e893735f185786e9774b2270ace1 diff --git a/client/src/variants/Hidden.js b/client/src/variants/Hidden.js index 96822b93..c79267a5 100644 --- a/client/src/variants/Hidden.js +++ b/client/src/variants/Hidden.js @@ -61,6 +61,18 @@ export const VariantRules = class HiddenRules extends ChessRules { return piece; } + getPpath(b, color, score) { + if (Object.keys(V.HIDDEN_DECODE).includes(b[1])) { + // Supposed to be hidden. + if (score == "*" && (!color || color != b[0])) + return "Hidden/" + b[0] + "p"; + // Else: condition OK to show the piece + return b[0] + V.HIDDEN_DECODE[b[1]]; + } + // The piece is already not supposed to be hidden: + return b; + } + // Scan board for kings positions (no castling) scanKingsRooks(fen) { this.kingPos = { w: [-1, -1], b: [-1, -1] }; @@ -87,18 +99,6 @@ export const VariantRules = class HiddenRules extends ChessRules { } } - getPpath(b, color, score) { - if (Object.keys(V.HIDDEN_DECODE).includes(b[1])) { - // Supposed to be hidden. - if (score == "*" && (!color || color != b[0])) - return "Hidden/" + b[0] + "p"; - // Else: condition OK to show the piece - return b[0] + V.HIDDEN_DECODE[b[1]]; - } - // The piece is already not supposed to be hidden: - return b; - } - getBasicMove([sx, sy], [ex, ey], tr) { if ( tr &&