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:
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:
const smove = move[moveIdx++];
// NOTE: condition "smove.start.x >= 0" required for Dynamo,
// because second move may be empty.
if (animate && smove.start.x >= 0) {
self.animateMove(smove, () => {
playSubmove(smove);
const smove = move[moveIdx++];
// NOTE: condition "smove.start.x >= 0" required for Dynamo,
// because second move may be empty.
if (animate && smove.start.x >= 0) {
self.animateMove(smove, () => {
playSubmove(smove);
if (moveIdx < move.length)
setTimeout(executeMove, 500);
else afterMove(smove, initurn);
if (moveIdx < move.length)
setTimeout(executeMove, 500);
else afterMove(smove, initurn);
};
const afterMove = (smove, initurn) => {
if (this.vr.turn != initurn) {
};
const afterMove = (smove, initurn) => {
if (this.vr.turn != initurn) {
// Turn has changed: move is complete
if (!smove.fen)
// NOTE: only FEN of last sub-move is required (=> setting it here)
// Turn has changed: move is complete
if (!smove.fen)
// NOTE: only FEN of last sub-move is required (=> setting it here)