+ const mirrorSide = (Object.keys(VariantRules.ALICE_CODES).includes(this.getPiece(x,y)) ? 1 : 2);
+ return moves.filter(m => {
+ if (this.board[m.end.x][m.end.y] != VariantRules.EMPTY)
+ {
+ const piece = this.getPiece(m.end.x,m.end.y);
+ if ((mirrorSide==1 && Object.keys(VariantRules.ALICE_PIECES).includes(piece))
+ || (mirrorSide==2 && Object.keys(VariantRules.ALICE_CODES).includes(piece)))
+ {
+ return false;
+ }
+ }
+ m.appear.forEach(psq => {
+ if (Object.keys(VariantRules.ALICE_CODES).includes(psq.p))
+ psq.p = VariantRules.ALICE_CODES[psq.p]; //goto board2
+ else
+ psq.p = VariantRules.ALICE_PIECES[psq.p]; //goto board1
+ });
+ return true;
+ });