- // Capture: update reserves
- this.Reserve[move.vanish
- const pIdx = ['p', 'r', 'n', 'b', 'q'].indexOf(move.vanish[1].p);
- // TODO
- if normal
- ? ChessRules.PIECES.findIndex(p => p == move.vanish[1].p)
- : V.NON_VIOLENT.findIndex(p => p == move.vanish[1].p);
- const rPiece = (normal ? V.NON_VIOLENT : ChessRules.PIECES)[pIdx];
- this.reserve[move.vanish[1].c][rPiece]++;
+ const normal = V.V_PIECES.includes(move.vanish[1].p);
+ const pIdx =
+ (normal ? V.V_PIECES : V.NV_PIECES).indexOf(move.vanish[1].p);
+ const resPiece = (normal ? V.NV_PIECES : V.V_PIECES)[pIdx];
+ super.updateReserve(C.GetOppTurn(this.turn), resPiece,
+ this.reserve[C.GetOppTurn(this.turn)][resPiece] + 1);