public void addFreeSquares(ArrayList<Point> points) { // add all squares for (int i = 0; i < GRID_WIDTH; i++) { for (int j = 0; j < GRID_HEIGHT; j++) { points.add(new Point(i, j)); } } // remove all pieces for (Piece piece : game.getPieces()) { if (!piece.isOut()) { points.remove(piece.getLocation()); } } }