public static Path findPath(IPosition start, IPosition end) {
		if ((start instanceof Door) && (end instanceof Door)) {
			// start and end are doors
			return findDoorToDoorPath((Door) start, (Door) end);
		}
		Point2D startPoint = start.getCentralPoint();
		Point2D endPoint = end.getCentralPoint();
		Room room = WorldFactory.getRoomWithPoints(startPoint, endPoint);
		if (room != null) {
			// Start and end are in the same room
			return findPathInRoom(startPoint, endPoint, room);
		}

		// Last case: different rooms
		Room startRoom = WorldFactory.getRoomsWithPoint(startPoint).getFirst();
		Room endRoom = WorldFactory.getRoomsWithPoint(endPoint).getFirst();
		Set<Door> startDoors = startRoom.getDoors();
		Set<Door> endDoors = endRoom.getDoors();
		Path doorToDoor = findRoomToRoomPath(startDoors, endDoors);
		if(doorToDoor == null) {
			return null;
		}
		Point2D startDoorPoint = doorToDoor.getFirst();
		Point2D endDoorPoint = doorToDoor.getLast();
		startRoom = WorldFactory.getRoomWithPoints(startPoint, startDoorPoint);
		endRoom = WorldFactory.getRoomWithPoints(endPoint, endDoorPoint);
		if (startRoom == null || endRoom == null) {
			log.warning("Can't find a start or end room! startRoom = "+startRoom+", endRoom = "+endRoom);
			return null;
		}

		Path startPath = findPathInRoom(startPoint, startDoorPoint, startRoom);
		Path endPath = findPathInRoom(endDoorPoint, endPoint, endRoom);
		startPath.removeLast();
		endPath.removeFirst();
		Path totalPath = new Path(startPoint, endPoint);
		totalPath.addAll(startPath);
		totalPath.addAll(doorToDoor);
		totalPath.addAll(endPath);
		return totalPath;

	}