4 .col-sm-12.col-md-10.col-md-offset-1
5 BaseGame(:game="game" :vr="vr" ref="basegame")
9 import BaseGame from "@/components/BaseGame.vue";
10 import { store } from "@/store";
11 import { ArrayFun } from "@/utils/array";
18 // gameRef: to find the game in (potentially remote) storage
22 gameRef: { //given in URL (rid = remote ID)
27 players:[{name:"Analyze"},{name:"Analyze"}],
30 vr: null, //"variant rules" object initialized from FEN
31 //people: [], //players + observers //TODO later: interactive analyze...
35 "$route": function(to, from) {
36 this.gameRef.fen = to.query["fen"].replace(/_/g, " ");
37 this.gameRef.vname = to.params["vname"];
42 this.gameRef.fen = this.$route.query["fen"].replace(/_/g, " ");
43 this.gameRef.vname = this.$route.params["vname"];
47 loadGame: async function() {
48 this.game.vname = this.gameRef.vname;
49 this.game.fen = this.gameRef.fen;
50 const vModule = await import("@/variants/" + this.game.vname + ".js");
51 window.V = vModule.VariantRules;
52 this.vr = new V(this.game.fen);
53 // fenStart initialized in the end, after definition of V,
54 // because it triggers a reset on BaseGame component.
55 this.$set(this.game, "fenStart", this.gameRef.fen); //TODO: Vue3...