+ getAllValidMoves()
+ {
+ const color = this.turn;
+ const oppCol = this.getOppCol(color);
+ var potentialMoves = [];
+ let [sizeX,sizeY] = VariantRules.size;
+ let sideBoard = [this.getSideBoard(1), this.getSideBoard(2)];
+ for (var i=0; i<sizeX; i++)
+ {
+ for (var j=0; j<sizeY; j++)
+ {
+ if (this.board[i][j] != VariantRules.EMPTY && this.getColor(i,j) == color)
+ {
+ const mirrorSide =
+ (Object.keys(VariantRules.ALICE_CODES).includes(this.getPiece(i,j)) ? 1 : 2);
+ Array.prototype.push.apply(potentialMoves,
+ this.getPotentialMovesFrom([i,j], sideBoard[mirrorSide-1]));
+ }
+ }
+ }
+ return this.filterValid(potentialMoves, sideBoard);
+ }
+
+ underCheck(move, sideBoard)