<script>
// This can work for squared boards (2 or 4 players), with some adaptations (TODO)
// TODO: for 3 players, write a "board3.js"
<script>
// This can work for squared boards (2 or 4 players), with some adaptations (TODO)
// TODO: for 3 players, write a "board3.js"
export default {
name: 'my-board',
// Last move cannot be guessed from here, and is required to highlight squares
// vr: object to check moves, print board...
// mode: HH, HC or analyze
// userColor: for mode HH or HC
export default {
name: 'my-board',
// Last move cannot be guessed from here, and is required to highlight squares
// vr: object to check moves, print board...
// mode: HH, HC or analyze
// userColor: for mode HH or HC
- props: ["vr","lastMove","mode","orientation","userColor"],
+ props: ["vr","lastMove","mode","orientation","userColor","vname"],
return;
const [sizeX,sizeY] = [V.size.x,V.size.y];
// Precompute hints squares to facilitate rendering
return;
const [sizeX,sizeY] = [V.size.x,V.size.y];
// Precompute hints squares to facilitate rendering
this.possibleMoves.forEach(m => { hintSquares[m.end.x][m.end.y] = true; });
// Also precompute in-check squares
this.possibleMoves.forEach(m => { hintSquares[m.end.x][m.end.y] = true; });
// Also precompute in-check squares
this.incheck.forEach(sq => { incheckSq[sq[0]][sq[1]] = true; });
const squareWidth = 40; //TODO: compute this
const choices = h(
this.incheck.forEach(sq => { incheckSq[sq[0]][sq[1]] = true; });
const squareWidth = 40; //TODO: compute this
const choices = h(
'light-square': (i+j)%2==0,
'dark-square': (i+j)%2==1,
[this.bcolor]: true,
'light-square': (i+j)%2==0,
'dark-square': (i+j)%2==1,
[this.bcolor]: true,
&& this.mode != "analyze"
&& !this.vr.enlightened[this.userColor][ci][cj],
'highlight': showLight && !!lm && lm.end.x == ci && lm.end.y == cj,
&& this.mode != "analyze"
&& !this.vr.enlightened[this.userColor][ci][cj],
'highlight': showLight && !!lm && lm.end.x == ci && lm.end.y == cj,