+ const orientation = !V.CanFlip ? "w" : this.orientation;
+ // Ensure that squares colors do not change when board is flipped
+ const lightSquareMod = (sizeX + sizeY) % 2;
+ const showPiece = (x, y) => {
+ return (
+ this.vr.board[x][y] != V.EMPTY &&
+ (!this.vr.enlightened || this.analyze || this.score != "*" ||
+ (!!this.userColor && this.vr.enlightened[this.userColor][x][y]))
+ );
+ };
+ const inHighlight = (x, y) => {
+ return showLight && !!lm && (
+ (lm.end.x == x && lm.end.y == y) ||
+ (lm.start.x == x && lm.start.y == y));
+ };
+ const inShadow = (x, y) => {
+ return (
+ !this.analyze &&
+ this.score == "*" &&
+ this.vr.enlightened &&
+ (!this.userColor || !this.vr.enlightened[this.userColor][x][y])
+ );
+ };
+ // Create board element (+ reserves if needed by variant)