- const vModule = await import("@/variants/" + game.vname + ".js");
- window.V = vModule.VariantRules;
- this.vr = new V(game.fen);
- // Post-processing: decorate each move with current FEN:
- // (to be able to jump to any position quickly)
- game.moves.forEach(move => {
- // NOTE: this is doing manually what BaseGame.play() achieve...
- // but in a lighter "fast-forward" way
- move.color = this.vr.turn;
- this.vr.play(move);
- move.fen = this.vr.getFen();
- });
- this.vr.re_init(game.fen);