- // The board may show some the possible moves: (TODO: bad solution)
- this.$refs["board"].resetCurrentAttempt();
+ const navigate = !move;
+ // Forbid playing outside analyze mode, except if move is received.
+ // Sufficient condition because Board already knows which turn it is.
+ if (
+ this.mode != "analyze" &&
+ !navigate &&
+ !received &&
+ (this.game.score != "*" || this.cursor < this.moves.length - 1)
+ ) {
+ return;
+ }
+ if (!!received) {
+ if (this.mode == "analyze") this.toggleAnalyze();
+ if (this.cursor < this.moves.length - 1)
+ // To play a received move, cursor must be at the end of the game:
+ this.gotoEnd();
+ }