/** * * @param positions * @param minX * Minimum x value in the list of positions. * @param minY * Minimum y value in the list of positions. * @param width * minX + width -1 is the maximum x value in the list of positions. * @param height * minY + height -1 is the maximum y value in the list of positions. */ public FreeMapArea(List<ShortPoint2D> positions, int minX, int minY, int width, int height) { assert positions.size() > 0 : "positions must contain at least one value!!"; this.positions = positions; this.xOffset = minX; this.yOffset = minY; this.width = width; this.height = height; this.areaMap = new boolean[width][height]; this.upperLeftPosition = setPositionsToMap(areaMap, positions); }
/** * @param positions * the positions this map area will contain. */ public FreeMapArea(List<ShortPoint2D> positions) { assert positions.size() > 0 : "positions must contain at least one value!!"; this.positions = positions; SRectangle bounds = getBounds(positions); this.xOffset = bounds.xMin; this.yOffset = bounds.yMin; this.width = bounds.getWidth() + 1; this.height = bounds.getHeight() + 1; this.areaMap = new boolean[width][height]; this.upperLeftPosition = setPositionsToMap(areaMap, positions); }