+ // Does this move takes opponent's king?
+ const oppCol = this.getOppCol(c);
+ for (let i=1; i<move.vanish.length; i++)
+ {
+ if (move.vanish[i].p == VariantRules.KING)
+ {
+ this.kingPos[oppCol] = [-1,-1];
+ break;
+ }
+ }
+ }
+
+ unupdateVariables(move)
+ {
+ super.unupdateVariables(move);
+ const c = this.getColor(move.start.x,move.start.y);
+ const oppCol = this.getOppCol(c);
+ if (this.kingPos[oppCol][0] < 0)
+ {
+ // Last move took opponent's king
+ for (let i=1; i<move.vanish.length; i++)
+ {
+ const psq = move.vanish[i];
+ if (psq.p == 'k')
+ {
+ this.kingPos[oppCol] = [psq.x, psq.y];
+ break;
+ }
+ }
+ }