+ if (!this.inMultimove) {
+ // First sub-move:
+ this.lastMove = smove;
+ // Condition is "!navigate" but we mean "!this.autoplay"
+ if (!navigate) {
+ if (this.cursor < this.moves.length - 1)
+ this.moves = this.moves.slice(0, this.cursor + 1);
+ this.moves.push(smove);
+ }
+ this.inMultimove = true; //potentially
+ this.cursor++;
+ } else if (!navigate) {
+ // Already in the middle of a multi-move
+ const L = this.moves.length;
+ if (!Array.isArray(this.moves[L-1]))
+ this.$set(this.moves, L-1, [this.moves[L-1], smove]);
+ else this.moves[L-1].push(smove);
+ }
+ };
+ const playMove = () => {
+ const animate = (
+ ["all", "highlight"].includes(V.ShowMoves) &&
+ (this.autoplay || !!received)
+ );
+ if (!Array.isArray(move)) move = [move];
+ let moveIdx = 0;
+ let self = this;
+ const initurn = this.vr.turn;
+ (function executeMove() {
+ const smove = move[moveIdx++];
+ // NOTE: condition "smove.start.x >= 0" required for Dynamo,
+ // because second move may be empty. noHighlight condition
+ // is used at least for Chakart.
+ if (animate && smove.start.x >= 0 && !smove.end.noHighlight) {
+ self.animateMove(smove, () => {
+ playSubmove(smove);
+ if (moveIdx < move.length) setTimeout(executeMove, 500);
+ else afterMove(smove, initurn);
+ });
+ } else {
+ playSubmove(smove);
+ if (moveIdx < move.length) executeMove();
+ else afterMove(smove, initurn);
+ }
+ })();
+ };
+ const computeScore = () => {