@Override public GreasedRegion expand8way(int amount) { for (int i = 0; i < amount; i++) { expand8way(); } return this; }
/** * Gets a new Zone that contains all the Coords in {@code this} plus all * neighboring Coords, which can be orthogonally or diagonally adjacent * to any Coord this has in it. Related to the expand() methods in * CoordPacker and GreasedRegion, but guaranteed to use 8-way adjacency * and to return a new Zone. This implementation returns a GreasedRegion * produced simply by {@code return copy().expand8way();} . * @return A new GreasedRegion where "off" cells adjacent to {@code this} * (orthogonally or diagonally) have been added to the "on" cells * in {@code this} */ @Override public GreasedRegion extend() { return copy().expand8way(); }
public GreasedRegion fringe8way() { GreasedRegion cpy = new GreasedRegion(this); expand8way(); return andNot(cpy); } public GreasedRegion fringe8way(int amount)
public GreasedRegion fringe8way(int amount) { GreasedRegion cpy = new GreasedRegion(this); expand8way(amount); return andNot(cpy); }
public GreasedRegion[] expandSeries8way(int amount) { if(amount <= 0) return new GreasedRegion[0]; GreasedRegion[] regions = new GreasedRegion[amount]; GreasedRegion temp = new GreasedRegion(this); for (int i = 0; i < amount; i++) { regions[i] = new GreasedRegion(temp.expand8way()); } return regions; } public ArrayList<GreasedRegion> expandSeriesToLimit8way()
public ArrayList<GreasedRegion> expandSeriesToLimit8way() { ArrayList<GreasedRegion> regions = new ArrayList<>(); GreasedRegion temp = new GreasedRegion(this); while (temp.size() != temp.expand8way().size()) { regions.add(new GreasedRegion(temp)); } return regions; }
/** * Like {@link #retract8way()}, this reduces the width of thick areas of this GreasedRegion, but thin8way() will not * remove areas that would be identical in a subsequent call to retract8way(), such as if the area would be * eliminated. This is useful primarily for adjusting areas so they do not exceed a width of 2 cells, though their * length (the longer of the two dimensions) will be unaffected by this. Especially wide, irregularly-shaped areas * may have unintended appearances if you call this repeatedly or use {@link #thinFully8way()}; consider using this * sparingly, or primarily when an area has just gotten thicker than desired. * <br> * This method was called {@link #thin()}, but now that name refers to a variant that uses 4-way adjacency. * @return this for chaining */ public GreasedRegion thin8way() { if(width <= 2 || ySections <= 0) return this; GreasedRegion c1 = new GreasedRegion(this).retract8way(), c2 = new GreasedRegion(c1).expand8way().xor(this).expand8way().and(this); remake(c1).or(c2); return this; }
public GreasedRegion[] fringeSeries8way(int amount) { if(amount <= 0) return new GreasedRegion[0]; GreasedRegion[] regions = new GreasedRegion[amount]; GreasedRegion temp = new GreasedRegion(this); regions[0] = new GreasedRegion(temp); for (int i = 1; i < amount; i++) { regions[i] = new GreasedRegion(temp.expand8way()); } for (int i = 0; i < amount - 1; i++) { regions[i].xor(regions[i + 1]); } regions[amount - 1].fringe8way(); return regions; } public ArrayList<GreasedRegion> fringeSeriesToLimit8way()
sty = Math.min(Math.max((zoomStartY - (height >> 1)) / ((2 << zoom) - 2), 0), height); for (int z = 0; z < zoom; z++) { earth.zoom(stx, sty).expand8way().fray(0.5).expand();
sty = Math.min(Math.max((zoomStartY - (height >> 1)) / ((2 << zoom) - 2), 0), height); for (int z = 0; z < zoom; z++) { earth.zoom(stx, sty).expand8way().fray(0.5).expand();
if(flooded.intersects(tmp.remake(room).expand8way())) change.add(room);
noticeable.refill(losResult, 0.0001, Double.POSITIVE_INFINITY).expand8way((int) Math.ceil(maxRange)); for (int i = 0; i < sz; i++) { pos = lights.keyAt(i);
if(nation.isEmpty()) continue; for (int z = 0; z < wmg.zoom; z++) { nation.zoom(stx, sty).expand8way().expand().fray(0.5);
int volume = 10 + (height * width) / (aLen * 2); area.empty().insert(pts[i]).spill(bounds, volume, rng).expand(3); tmpInner.remake(area).retract(4).expand8way().and(area); tmpEdge.remake(area).surface8way(); Coord[] edges = tmpEdge.mixedRandomSeparated(0.35);