-// else
-// {
-// VariantRules.PlayOnBoard(this.vr.board, move);
-// this.$forceUpdate(); //TODO: ?!
-// }
- if (["human","computer","friend"].includes(this.mode))
- this.updateStorage(); //after our moves and opponent moves
- if (this.mode == "computer" && this.vr.turn != this.mycolor && this.score == "*")
- this.playComputerMove();
- },
- // TODO: merge two next functions
- undo: function() {
- // Navigate after game is over
- if (this.cursor == 0)
- return; //already at the beginning
- if (this.cursor == this.vr.moves.length)
- this.incheck = []; //in case of...
- const move = this.vr.moves[--this.cursor];
- VariantRules.UndoOnBoard(this.vr.board, move);
- this.$forceUpdate(); //TODO: ?!
- },
- undoInGame: function() {
- const lm = this.vr.lastMove;
- if (!!lm)
+ else if (this.mode == "computer")
+ {
+ // Send the move to web worker (including his own moves)
+ this.compWorker.postMessage(["newmove",move]);
+ }
+ if (this.score == "*" || this.mode == "analyze")