X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FDark.js;h=3bca23404ecd2dae30dbeff359d9ee21d7c79244;hb=32f6285ee325a14286562a53baefc647201df2af;hp=96163bfb00715c62be201000d04c0e405b0f7eea;hpb=c3d16e78d99e27ddd294647f8f97751727069d5a;p=vchess.git diff --git a/client/src/variants/Dark.js b/client/src/variants/Dark.js index 96163bfb..3bca2340 100644 --- a/client/src/variants/Dark.js +++ b/client/src/variants/Dark.js @@ -2,7 +2,7 @@ import { ChessRules } from "@/base_rules"; import { ArrayFun } from "@/utils/array"; import { randInt } from "@/utils/alea"; -export const VariantRules = class DarkRules extends ChessRules { +export class DarkRules extends ChessRules { // Analyse in Dark mode makes no sense static get CanAnalyze() { return false; @@ -103,8 +103,8 @@ export const VariantRules = class DarkRules extends ChessRules { return []; } - updateVariables(move) { - super.updateVariables(move); + postPlay(move) { + super.postPlay(move); if (move.vanish.length >= 2 && move.vanish[1].p == V.KING) // We took opponent king (because if castle vanish[1] is a rook) this.kingPos[this.turn] = [-1, -1]; @@ -113,8 +113,8 @@ export const VariantRules = class DarkRules extends ChessRules { this.updateEnlightened(); } - 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)