projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes
[vchess.git]
/
client
/
src
/
components
/
ComputerGame.vue
diff --git
a/client/src/components/ComputerGame.vue
b/client/src/components/ComputerGame.vue
index
0d566a8
..
b1d2b37
100644
(file)
--- a/
client/src/components/ComputerGame.vue
+++ b/
client/src/components/ComputerGame.vue
@@
-1,5
+1,6
@@
<template lang="pug">
BaseGame(
<template lang="pug">
BaseGame(
+ ref="basegame"
:game="game"
:vr="vr"
@newmove="processMove"
:game="game"
:vr="vr"
@newmove="processMove"
@@
-41,7
+42,6
@@
export default {
}
}
},
}
}
},
- // Modal end of game, and then sub-components
created: function() {
// Computer moves web worker logic:
this.compWorker = new Worker();
created: function() {
// Computer moves web worker logic:
this.compWorker = new Worker();
@@
-63,7
+63,7
@@
export default {
let moveIdx = 0;
let self = this;
(function executeMove() {
let moveIdx = 0;
let self = this;
(function executeMove() {
- self.$
set(self.game, "moveToPlay",
compMove[moveIdx++]);
+ self.$
refs["basegame"].play(
compMove[moveIdx++]);
if (moveIdx >= compMove.length) {
self.compThink = false;
if (self.game.score != "*")
if (moveIdx >= compMove.length) {
self.compThink = false;
if (self.game.score != "*")
@@
-95,6
+95,8
@@
export default {
if (mycolor != "w" || this.gameInfo.mode == "auto")
this.playComputerMove();
},
if (mycolor != "w" || this.gameInfo.mode == "auto")
this.playComputerMove();
},
+ // NOTE: a "goto" action could lead to an error when comp is thinking,
+ // but it's OK because from the user viewpoint the game just stops.
playComputerMove: function() {
this.timeStart = Date.now();
this.compThink = true;
playComputerMove: function() {
this.timeStart = Date.now();
this.compThink = true;