private void buildBoard() {
		int rows = polymino.boardRows();
		int cols = polymino.boardCols();
		if (board == null) {
			board = new int[rows][cols];
		}
		for (int row = 0; row < rows; ++row) {
			for (int col = 0; col < cols; ++col) {
				if (polymino.getBoard()[row][col]) {
					// wall
					board[row][col] = -2;
				} else {
					// unoccupied
					board[row][col] = -1;
				}
			}
		}

		for (PiecePart constraint : stack) {
			int pieceRows = constraint.pieceRows();
			int pieceCols = constraint.pieceCols();
			int boardRow = constraint.boardRow();
			int boardCol = constraint.boardCol();
			int id = constraint.getPiece().getId();
			for (int row = 0; row < pieceRows; ++row) {
				for (int col = 0; col < pieceCols; ++col) {
					if (constraint.occupied(row, col)) {
						board[boardRow + row][boardCol + col] = id;
					}
				}
			}
		}
	}