+ if (firstMoveColor == "b") {
+ // 'start' & 'end' is required for Board component
+ this.moves.unshift({
+ notation: "...",
+ start: { x: -1, y: -1 },
+ end: { x: -1, y: -1 },
+ fen: game.fenStart
+ });
+ L++;
+ }
+ this.positionCursorTo(this.moves.length - 1);
+ this.incheck = this.vr.getCheckSquares(this.vr.turn);
+ const score = this.vr.getCurrentScore();
+ if (L > 0 && this.moves[L - 1].notation != "...") {
+ if (["1-0","0-1"].includes(score))
+ this.moves[L - 1].notation += "#";
+ else if (this.vr.getCheckSquares(this.vr.turn).length > 0)
+ this.moves[L - 1].notation += "+";
+ }
+ },
+ positionCursorTo: function(index) {
+ this.cursor = index;
+ // Caution: last move in moves array might be a multi-move
+ if (index >= 0) {
+ if (Array.isArray(this.moves[index])) {
+ const L = this.moves[index].length;
+ this.lastMove = this.moves[index][L - 1];
+ } else {
+ this.lastMove = this.moves[index];
+ }
+ } else this.lastMove = null;
+ },
+ analyzePosition: function() {
+ let newUrl =
+ "/analyse/" +
+ this.game.vname +
+ "/?fen=" +
+ this.vr.getFen().replace(/ /g, "_");
+ if (this.game.mycolor)
+ newUrl += "&side=" + this.game.mycolor;
+ // Open in same tab in live games (against cheating)
+ if (this.game.type == "live") this.$router.push(newUrl);
+ else window.open("#" + newUrl);