private void putCircle(int radius, float multiplier) { putModule(CoordPacker.circle(Coord.get(Math.round(radius * multiplier + 1), Math.round(radius * multiplier + 1)), Math.round(radius * multiplier), Math.round((radius + 1) * 2 * multiplier + 1), Math.round((radius + 1) * 2 * multiplier + 1))); }
/** * A constructor for a circular Region (possibly truncated at the edges) with a Coord center, an int radius, and a * maximum width and height that the Coords in this Region will not exceed. * @param center the center of the circular Region * @param circleRadius the radius as an int * @param mapWidth one more than the maximum x-position of any Coord this will contain * @param mapHeight one more than the maximum y-position of any Coord this will contain */ public Region(Coord center, int circleRadius, int mapWidth, int mapHeight) { CoordPacker.init(); raw = circle(center, circleRadius, mapWidth, mapHeight); coords = allPacked(raw); dirty = false; }