+ updateVariables(move)
+ {
+ super.updateVariables(move);
+ if (move.appear.length == 2 && move.vanish.length == 2
+ && move.appear[1].p == VariantRules.KING)
+ {
+ // Switch with the king; not castle, and not handled by main class
+ const color = this.getColor(move.start.x, move.start.y);
+ this.kingPos[color] = [move.appear[1].x, move.appear[1].y];
+ }
+ }
+
+ unupdateVariables(move)
+ {
+ super.unupdateVariables(move);
+ if (move.appear.length == 2 && move.vanish.length == 2
+ && move.appear[1].p == VariantRules.KING)
+ {
+ const color = this.getColor(move.start.x, move.start.y);
+ this.kingPos[color] = [move.appear[0].x, move.appear[0].y];
+ }
+ }
+