+ processMove: function(move) {
+ playMove(move, this.vr);
+ // This move could have ended the game: if this is the case,
+ // the game is already removed from storage (if mode == 'versus')
+ if (this.game.score != "*") return;
+ // Send the move to web worker (including his own moves)
+ this.compWorker.postMessage(["newmove", move]);
+ if (this.gameInfo.mode == "auto" || this.vr.turn != this.game.mycolor)
+ this.playComputerMove();
+ // Finally, update storage:
+ if (this.gameInfo.mode == "versus") {
+ CompgameStorage.update(this.gameInfo.vname, {
+ move: getFilteredMove(move),
+ fen: this.vr.getFen()
+ });
+ }
+ },
+ gameOver: function(score, scoreMsg) {
+ this.game.score = score;
+ this.game.scoreMsg = scoreMsg;
+ if (!this.compThink) this.$emit("game-stopped"); //otherwise wait for comp
+ }
+ }