public class CameraSpaceIterator extends AbstractMapIterator
blockIterator, map, useChunks
Constructor and Description |
---|
CameraSpaceIterator(AbstractMap map,
int centerCoordX,
int centerCoordY,
int startingZ,
int topLevel)
Starts at z=-1.
|
Modifier and Type | Method and Description |
---|---|
Chunk |
getCurrentChunk() |
int[] |
getCurrentIndex()
get the indices position inside the chunk/data matrix
|
boolean |
hasNext() |
boolean |
hasNextChunk()
Check if the iterator has a next chunk
|
CoreData |
next()
Loops over the map areas covered by the camera.
|
getStartingZ, getTopLimitZ, remove, setStartingZ, setTopLimitZ
public CameraSpaceIterator(AbstractMap map, int centerCoordX, int centerCoordY, int startingZ, int topLevel)
map
- centerCoordX
- the center chunk coordinatecenterCoordY
- the center chunk coordinatestartingZ
- to loop over ground level pass -1topLevel
- the top limit of the z axispublic CoreData next() throws java.util.NoSuchElementException
java.util.NoSuchElementException
public int[] getCurrentIndex()
public Chunk getCurrentChunk()
public boolean hasNextChunk()
AbstractMapIterator
hasNextChunk
in class AbstractMapIterator
public boolean hasNext()
hasNext
in interface java.util.Iterator<CoreData>
hasNext
in class AbstractMapIterator