X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=a5e03b31025d2f6d0471d1ad3e44572be5d6d87f;hp=b1d2b37064e1ec652e75a924dd5fb277ae4f7040;hb=866842c3c310524c034922870234120ed2a16cbf;hpb=8477e53d8e78606e4c4e4bf91c77b1011aab583c diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index b1d2b370..a5e03b31 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -35,12 +35,6 @@ export default { "gameInfo.fen": function() { this.launchGame(); }, - "gameInfo.score": function(newScore) { - if (newScore != "*") { - this.game.score = newScore; //user action - if (!this.compThink) this.$emit("game-stopped"); //otherwise wait for comp - } - } }, created: function() { // Computer moves web worker logic: @@ -63,7 +57,7 @@ export default { let moveIdx = 0; let self = this; (function executeMove() { - self.$refs["basegame"].play(compMove[moveIdx++]); + self.$refs["basegame"].play(compMove[moveIdx++], "received"); if (moveIdx >= compMove.length) { self.compThink = false; if (self.game.score != "*") @@ -117,7 +111,7 @@ export default { gameOver: function(score, scoreMsg) { this.game.score = score; this.game.scoreMsg = scoreMsg; - this.$emit("game-over", score); //bubble up to Rules.vue + if (!this.compThink) this.$emit("game-stopped"); //otherwise wait for comp } } };