|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.aranai.dungeonator.dungeonchunk.DungeonChunk
public class DungeonChunk
Stores and manipulates Dungeonator chunk information, including type, neighbors, and doorways.
Field Summary | |
---|---|
private org.bukkit.Chunk |
chunk
The handle for the chunk data |
private DungeonChunkDoorway[] |
doorways
Doorways |
private DungeonChunk[] |
neighbors
Neighboring chunks (NESW) |
private long |
seed
Random seed used for procedural chunks. |
private DungeonChunkType |
type
Chunk type |
private java.lang.String |
world
The world name. |
private int |
x
X coordinate for the chunk. |
private int |
z
Z coordinate for the chunk. |
Constructor Summary | |
---|---|
DungeonChunk()
Instantiates a new dungeon chunk. |
|
DungeonChunk(org.bukkit.Chunk chunk)
Instantiates a new dungeon chunk from an existing chunk |
|
DungeonChunk(DungeonChunkType type)
Instantiates a new dungeon chunk with a specified DungeonChunkType. |
|
DungeonChunk(DungeonChunkType type,
java.lang.String world,
int x,
int z,
org.bukkit.Chunk chunk)
|
Method Summary | |
---|---|
DungeonChunkDoorway |
getDoorway(byte direction)
Gets the doorway matching the specified direction. |
java.util.Vector<DungeonChunkDoorway> |
getDoorwaysOnSide(byte[] side)
Gets all of the doorways on the specified side. |
org.bukkit.Chunk |
getHandle()
Gets the handle for the DungeonChunk's chunk data. |
IDungeonChunk |
getNeighbor(byte direction)
Gets the neighboring chunk matching the specified direction. |
long |
getSeed()
Gets the seed. |
DungeonChunkType |
getType()
Gets the DungeonChunkType for the chunk. |
java.lang.String |
getWorld()
Gets the world name. |
int |
getX()
Gets the x coordinate for the chunk. |
int |
getZ()
Gets the z coordinate for the chunk. |
boolean |
hasDoorway(byte d)
Checks for a doorway matching the specified direction. |
boolean |
hasNeighbor(byte direction)
Checks for a neighboring chunk matching the specified direction. |
boolean |
isValidChunkDirection(byte direction)
Checks if the specified direction is a valid chunk direction (NESW) |
void |
setDoorway(DungeonChunkDoorway doorway)
Sets a doorway. |
void |
setHandle(org.bukkit.Chunk handle)
Sets the handle for the DungeonChunk's chunk data. |
void |
setNeighbor(byte direction,
IDungeonChunk neighbor)
Sets the neighboring chunk for the specified direction. |
void |
setSeed(long seed)
Sets the seed. |
void |
setType(DungeonChunkType type)
Sets the DungeonChunkType for the chunk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String world
private int x
private int z
private org.bukkit.Chunk chunk
private long seed
private DungeonChunkType type
private DungeonChunk[] neighbors
private DungeonChunkDoorway[] doorways
Constructor Detail |
---|
public DungeonChunk()
public DungeonChunk(DungeonChunkType type)
type
- the typepublic DungeonChunk(org.bukkit.Chunk chunk)
chunk
- the chunkpublic DungeonChunk(DungeonChunkType type, java.lang.String world, int x, int z, org.bukkit.Chunk chunk)
Method Detail |
---|
public java.lang.String getWorld()
IDungeonChunk
getWorld
in interface IDungeonChunk
public int getX()
IDungeonChunk
getX
in interface IDungeonChunk
public int getZ()
IDungeonChunk
getZ
in interface IDungeonChunk
public long getSeed()
IDungeonChunk
getSeed
in interface IDungeonChunk
public void setSeed(long seed)
IDungeonChunk
setSeed
in interface IDungeonChunk
seed
- the new seedpublic DungeonChunkType getType()
IDungeonChunk
getType
in interface IDungeonChunk
public void setType(DungeonChunkType type)
IDungeonChunk
setType
in interface IDungeonChunk
type
- the new typepublic boolean hasDoorway(byte d)
IDungeonChunk
hasDoorway
in interface IDungeonChunk
public DungeonChunkDoorway getDoorway(byte direction)
IDungeonChunk
getDoorway
in interface IDungeonChunk
direction
- the direction of the doorway to get
public java.util.Vector<DungeonChunkDoorway> getDoorwaysOnSide(byte[] side)
IDungeonChunk
getDoorwaysOnSide
in interface IDungeonChunk
public void setDoorway(DungeonChunkDoorway doorway)
IDungeonChunk
setDoorway
in interface IDungeonChunk
doorway
- the DungeonChunkDoorway to setpublic boolean hasNeighbor(byte direction)
IDungeonChunk
hasNeighbor
in interface IDungeonChunk
public IDungeonChunk getNeighbor(byte direction)
IDungeonChunk
getNeighbor
in interface IDungeonChunk
direction
- the direction of the chunk to get
public void setNeighbor(byte direction, IDungeonChunk neighbor)
IDungeonChunk
setNeighbor
in interface IDungeonChunk
direction
- the direction of the neighbor to setneighbor
- the chunk to set as a neighborpublic org.bukkit.Chunk getHandle()
IDungeonChunk
getHandle
in interface IDungeonChunk
public void setHandle(org.bukkit.Chunk handle)
IDungeonChunk
setHandle
in interface IDungeonChunk
public boolean isValidChunkDirection(byte direction)
direction
- the direction to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |