public ArrayList<GreasedRegion> retractSeriesToLimit8way() { ArrayList<GreasedRegion> regions = new ArrayList<>(); GreasedRegion temp = new GreasedRegion(this); while (!temp.retract8way().isEmpty()) { regions.add(new GreasedRegion(temp)); } return regions; }
public ArrayList<GreasedRegion> retractSeriesToLimit() { ArrayList<GreasedRegion> regions = new ArrayList<>(); GreasedRegion temp = new GreasedRegion(this); while (!temp.retract().isEmpty()) { regions.add(new GreasedRegion(temp)); } return regions; }
/** * Gets the distance between the minimum y-value contained in this GreasedRegion and the maximum y-value in it. * Not the same as accessing the field {@link #height} on a GreasedRegion! The field will get the span of the space * that the GreasedRegion can use, including "on" and "off" cells. This method will only get the distance between * the furthest-separated "on" cells on the y-axis, and won't consider "off" cells. This method can return -1 if the * GreasedRegion is empty, 0 if the "on" cells are all in a horizontal line (that is, when the minimum y is equal to * the maximum y), or a positive int in other cases with multiple y-values. * @return the distance on the y-axis between the "on" cell with the lowest y-value and the one with the highest */ @Override public int getHeight() { if (super.height == -2) super.height = isEmpty() ? -1 : y(false) - y(true); return super.height; }
/** * Gets the distance between the minimum x-value contained in this GreasedRegion and the maximum x-value in it. * Not the same as accessing the field {@link #width} on a GreasedRegion! The field will get the span of the space * that the GreasedRegion can use, including "on" and "off" cells. This method will only get the distance between * the furthest-separated "on" cells on the x-axis, and won't consider "off" cells. This method can return -1 if the * GreasedRegion is empty, 0 if the "on" cells are all in a vertical line (that is, when the minimum x is equal to * the maximum x), or a positive int in other cases with multiple x-values. * @return the distance on the x-axis between the "on" cell with the lowest x-value and the one with the highest */ @Override public int getWidth() { if (super.width == -2) super.width = isEmpty() ? -1 : x(false) - x(true); return super.width; } /**
for (int i = 1; i < atlas.size(); i++) { nation.refill(politicalMap, c = atlas.keyAt(i)); if(nation.isEmpty()) continue; for (int z = 0; z < wmg.zoom; z++) { nation.zoom(stx, sty).expand8way().expand().fray(0.5); if(nation.isEmpty()) continue; nation.flood(fillable, 4 << wmg.zoom).intoChars(zoomedMap, c);
if (working.isEmpty()) continue; floors.andNot(working);
working2 = region.copy().retract(); for (int i = 2; i < 7; i++) { if(working2.isEmpty()) break; working = working2.copy();
if (working.isEmpty()) continue; floors.andNot(working);