- this.reserve =
- {
- "w":
- {
- [V.PAWN]: parseInt(fenParsed.reserve[0]),
- [V.ROOK]: parseInt(fenParsed.reserve[1]),
- [V.KNIGHT]: parseInt(fenParsed.reserve[2]),
- [V.BISHOP]: parseInt(fenParsed.reserve[3]),
- [V.QUEEN]: parseInt(fenParsed.reserve[4]),
+ const reserve =
+ V.ParseFen(fen).reserve.split("").map(x => parseInt(x, 10));
+ this.reserve = {
+ w: {
+ [V.PAWN]: reserve[0],
+ [V.ROOK]: reserve[1],
+ [V.KNIGHT]: reserve[2],
+ [V.BISHOP]: reserve[3],
+ [V.QUEEN]: reserve[4]