projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revise server code + a few fixes in trnalsations and ComputerGame
[vchess.git]
/
client
/
src
/
components
/
ComputerGame.vue
diff --git
a/client/src/components/ComputerGame.vue
b/client/src/components/ComputerGame.vue
index
b1d2b37
..
a5e03b3
100644
(file)
--- a/
client/src/components/ComputerGame.vue
+++ b/
client/src/components/ComputerGame.vue
@@
-35,12
+35,6
@@
export default {
"gameInfo.fen": function() {
this.launchGame();
},
"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:
},
created: function() {
// Computer moves web worker logic:
@@
-63,7
+57,7
@@
export default {
let moveIdx = 0;
let self = this;
(function executeMove() {
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 != "*")
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;
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
}
}
};
}
}
};