mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Add FlatRegion interface and an associated iterator
This commit is contained in:
@ -37,7 +37,7 @@ import com.sk89q.worldedit.data.ChunkStore;
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class Polygonal2DRegion extends AbstractRegion {
|
||||
public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
private List<BlockVector2D> points;
|
||||
private BlockVector min;
|
||||
private BlockVector max;
|
||||
@ -469,6 +469,16 @@ public class Polygonal2DRegion extends AbstractRegion {
|
||||
return new RegionIterator(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Vector2D> asFlatRegion() {
|
||||
return new Iterable<Vector2D>() {
|
||||
@Override
|
||||
public Iterator<Vector2D> iterator() {
|
||||
return new FlatRegionIterator(Polygonal2DRegion.this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns string representation in the format
|
||||
* "(x1, z1) - ... - (xN, zN) * (minY - maxY)"
|
||||
|
Reference in New Issue
Block a user