X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=8c0ac3825cac644106e77ba0a9e0a0173310194c;hp=2070cd09e076722917776200046e66ea1d13b851;hb=37cdcbf303d3c2e57b388a1abc9f853ba68a55cd;hpb=1c9f093dad69e4c7b6d2b42cb5e0bd3bc7224ec9 diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index 2070cd09..8c0ac382 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -80,23 +80,15 @@ export default { }, newGameFromFen: function(fen) { this.vr = new V(fen); - this.moves = []; - this.cursor = -1; this.fenStart = fen; - this.score = "*"; - if (this.mode == "analyze") - { - this.mycolor = V.ParseFen(fen).turn; - this.orientation = this.mycolor; - } - else if (this.mode == "computer") //only other alternative (HH with gameId) - { - this.mycolor = (Math.random() < 0.5 ? "w" : "b"); - this.orientation = this.mycolor; - this.compWorker.postMessage(["init",fen]); - if (this.mycolor != "w" || this.mode == "auto") - this.playComputerMove(); - } + this.mycolor = (Math.random() < 0.5 ? "w" : "b"); + console.log(this.mycolor); + this.players = ["Myself","Computer"]; + if (this.mycolor == "b") + this.players = this.players.reverse(); + this.compWorker.postMessage(["init",fen]); + if (this.mycolor != "w" || this.mode == "auto") + this.playComputerMove(); }, playComputerMove: function() { this.timeStart = Date.now();