3 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
4 BaseGame(:game="game" :vr="vr" ref="basegame")
8 import BaseGame from "@/components/BaseGame.vue";
9 import { store } from "@/store";
10 import { ArrayFun } from "@/utils/array";
17 // gameRef: to find the game in (potentially remote) storage
21 gameRef: { //given in URL (rid = remote ID)
26 players:[{name:"Analyze"},{name:"Analyze"}],
29 vr: null, //"variant rules" object initialized from FEN
30 //people: [], //players + observers //TODO later: interactive analyze...
34 "$route": function(to, from) {
35 this.gameRef.fen = to.query["fen"].replace(/_/g, " ");
36 this.gameRef.vname = to.params["vname"];
41 this.gameRef.fen = this.$route.query["fen"].replace(/_/g, " ");
42 this.gameRef.vname = this.$route.params["vname"];
46 loadGame: async function() {
47 this.game.vname = this.gameRef.vname;
48 this.game.fen = this.gameRef.fen;
49 const vModule = await import("@/variants/" + this.game.vname + ".js");
50 window.V = vModule.VariantRules;
51 this.vr = new V(this.game.fen);