private void adding(Road road, Path path) { roadHelper.setPathId(road.getID(), path.getId()); if (!path.contains(road)) { path.add(road); if (entrances.contains(road)) { path.addEntrance(getEntrance(road)); } } }
private void addEntrances(Path path, Road road) { Entrance entrance; for (Road n : roadHelper.getConnectedRoads(road.getID())) { if (entrances.contains(n)) { roadHelper.setPathId(n.getID(), path.getId()); if (!path.contains(n) && !added.contains(n)) { path.add(n); added.add(n); } entrance = getEntrance(n); if (!path.getEntrances().contains(entrance)) { path.addEntrance(entrance); } } } }