public class RegionIntersection extends AbstractRegion
iterator()
returns a special iterator that will iterate through
the iterators of each region in an undefined sequence. Some positions may
be repeated if the position is contained in more than one region, but this cannot
be guaranteed to occur.
world
Constructor and Description |
---|
RegionIntersection(java.util.List<Region> regions)
Create a new instance with the included list of regions.
|
RegionIntersection(LocalWorld world,
java.util.List<Region> regions)
Create a new instance with the included list of regions.
|
RegionIntersection(LocalWorld world,
Region... regions)
Create a new instance with the included list of regions.
|
RegionIntersection(Region... regions)
Create a new instance with the included list of regions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Vector position)
Returns true based on whether the region contains the point.
|
void |
contract(Vector... changes)
Contract the region.
|
void |
expand(Vector... changes)
Expand the region.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
java.util.Iterator<BlockVector> |
iterator()
Get the iterator.
|
clone, getArea, getCenter, getChunkCubes, getChunks, getHeight, getLength, getWidth, getWorld, polygonize, setWorld, setWorld, shift
public RegionIntersection(java.util.List<Region> regions)
regions
- a list of regions, which is copiedpublic RegionIntersection(Region... regions)
regions
- a list of regions, which is copiedpublic RegionIntersection(LocalWorld world, java.util.List<Region> regions)
world
- the worldregions
- a list of regions, which is copiedpublic RegionIntersection(LocalWorld world, Region... regions)
world
- the worldregions
- an array of regions, which is copiedpublic Vector getMinimumPoint()
Region
public Vector getMaximumPoint()
Region
public void expand(Vector... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
public void contract(Vector... changes) throws RegionOperationException
Region
changes
- array/arguments with multiple related changesRegionOperationException
public boolean contains(Vector position)
Region
position
- the positionpublic java.util.Iterator<BlockVector> iterator()
AbstractRegion
iterator
in interface java.lang.Iterable<BlockVector>
iterator
in class AbstractRegion