+ // Play on sideboards [TODO: only one sideBoard required]
+ playSide(move, sideBoard)
+ {
+ const pieces = Object.keys(VariantRules.ALICE_CODES);
+ move.vanish.forEach(psq => {
+ const mirrorSide = (pieces.includes(psq.p) ? 1 : 2);
+ sideBoard[mirrorSide-1][psq.x][psq.y] = VariantRules.EMPTY;
+ });
+ move.appear.forEach(psq => {
+ const mirrorSide = (pieces.includes(psq.p) ? 1 : 2);
+ const piece = (mirrorSide == 1 ? psq.p : VariantRules.ALICE_PIECES[psq.p]);
+ sideBoard[mirrorSide-1][psq.x][psq.y] = psq.c + piece;
+ if (piece == VariantRules.KING)
+ this.kingPos[psq.c] = [psq.x,psq.y];
+ });
+ }
+
+ // Undo on sideboards
+ undoSide(move, sideBoard)