+ let lm = this.lastMove;
+ // Precompute lastMove highlighting squares
+ const lmHighlights = {};
+ if (!!lm) {
+ if (!Array.isArray(lm)) lm = [lm];
+ lm.forEach(m => {
+ lmHighlights[m.start.x + sizeX * m.start.y] = true;
+ lmHighlights[m.end.x + sizeX * m.end.y] = true;
+ });
+ }