- const c = this.turn;
- const oppCol = this.getOppCol(c);
- this.play(move)
- let res = this.isAttacked(this.kingPos[c], [oppCol])
- || !this.isAttacked(this.antikingPos[c], [oppCol]);
- this.undo(move);
+ const oppCol = this.getOppCol(color);
+ let res = this.isAttacked(this.kingPos[color], [oppCol])
+ || !this.isAttacked(this.antikingPos[color], [oppCol]);