3 BaseGame(:game="game" :vr="vr" ref="basegame")
7 import BaseGame from "@/components/BaseGame.vue";
8 import { store } from "@/store";
9 import { ArrayFun } from "@/utils/array";
16 // gameRef: to find the game in (potentially remote) storage
20 gameRef: { //given in URL (rid = remote ID)
25 players:[{name:"Analyze"},{name:"Analyze"}],
28 vr: null, //"variant rules" object initialized from FEN
29 //people: [], //players + observers //TODO later: interactive analyze...
33 "$route": function(to, from) {
34 this.gameRef.fen = to.query["fen"].replace(/_/g, " ");
35 this.gameRef.vname = to.params["vname"];
40 this.gameRef.fen = this.$route.query["fen"].replace(/_/g, " ");
41 this.gameRef.vname = this.$route.params["vname"];
45 loadGame: async function() {
46 this.game.vname = this.gameRef.vname;
47 this.game.fen = this.gameRef.fen;
48 const vModule = await import("@/variants/" + this.game.vname + ".js");
49 window.V = vModule.VariantRules;
50 this.vr = new V(this.game.fen);