X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fboard.js;fp=public%2Fjavascripts%2Fcomponents%2Fboard.js;h=2861cf7fd6ce787ddb646c324d98d5fbe6d8c19d;hb=8ef618ef05070642849f50861399116c2d69a816;hp=e786e899fda24261165f68c67c2c1f1289cf522b;hpb=ff1d4c3f43d8333e9629a8e59606c234cb10869f;p=vchess.git diff --git a/public/javascripts/components/board.js b/public/javascripts/components/board.js index e786e899..2861cf7f 100644 --- a/public/javascripts/components/board.js +++ b/public/javascripts/components/board.js @@ -8,7 +8,9 @@ vr: null, //object to check moves, store them, FEN.. orientation: "w", //useful if click on "flip board" - + +// TODO: watch for property change "fen" +// send event after each move, to notify what was played const [sizeX,sizeY] = [V.size.x,V.size.y]; // Precompute hints squares to facilitate rendering @@ -289,6 +291,10 @@ this.possibleMoves = []; if (this.score == "*") { + +// TODO: essentially adapt this (all other things do not change much) +// if inside a real game, mycolor should be provided ? (simplest way) + const color = ["friend","problem"].includes(this.mode) ? this.vr.turn : this.mycolor;