- loadGame: async function() {
- GameStorage.get(this.gameRef, (game) => {
- this.gameInfo =
- this.vname = game.vname;
- this.mode = game.mode;
- const vModule = await import("@/variants/" + this.vname + ".js");
+ loadGame: function() {
+ GameStorage.get(this.gameRef, async (game) => {
+ this.game = Object.assign({},
+ game,
+ // NOTE: assign mycolor here, since BaseGame could also bs VS computer
+ {mycolor: ["w","b"][game.players.findIndex(p => p.sid == this.st.user.sid)]},
+ );
+ const vModule = await import("@/variants/" + game.vname + ".js");