com.aranai.dungeonator.generator
Class Cuboid

java.lang.Object
  extended by com.aranai.dungeonator.generator.Cuboid

public class Cuboid
extends java.lang.Object

The Cuboid class allows for cubic regions of variable size and thickness to be specified at a given offset from the chunk origin. This is useful for specifying walls, rooms, and other cubic volumes with minimal fuss.


Field Summary
private  int offsetX
          The x offset from the chunk origin.
private  int offsetY
          The y offset from the chunk origin.
private  int offsetZ
          The z offset from the chunk origin.
private  int sizeX
          The cuboid width.
private  int sizeY
          The cuboid height.
private  int sizeZ
          The cuboid depth.
private  int thickness
          The cuboid wall thickness, or 0 if the cuboid is solid.
 
Constructor Summary
Cuboid()
          Instantiates a new cuboid with default values.
Cuboid(int x, int y, int z)
          Instantiates a new cuboid with size values.
Cuboid(int x, int y, int z, int t)
          Instantiates a new cuboid with size and thickness values.
Cuboid(int offX, int offY, int offZ, int x, int y, int z)
          Instantiates a new cuboid with size and offset values.
Cuboid(int offX, int offY, int offZ, int x, int y, int z, int t)
          Instantiates a new cuboid with all values.
 
Method Summary
 org.bukkit.Location getOffsetLocation()
          Gets the offset as a location.
 int getOffsetX()
          Gets the x offset from chunk origin.
 int getOffsetY()
          Gets the y offset from chunk origin.
 int getOffsetZ()
          Gets the z offset from chunk origin
 int getSizeX()
          Gets the cuboid's width.
 int getSizeY()
          Gets the cuboid's height.
 int getSizeZ()
          Gets the cuboid's depth.
private  int getThickness()
          Gets the cuboid's wall thickness.
 boolean isSolid()
          Checks if the cuboid is solid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offsetX

private int offsetX
The x offset from the chunk origin.


offsetY

private int offsetY
The y offset from the chunk origin.


offsetZ

private int offsetZ
The z offset from the chunk origin.


sizeX

private int sizeX
The cuboid width.


sizeY

private int sizeY
The cuboid height.


sizeZ

private int sizeZ
The cuboid depth.


thickness

private int thickness
The cuboid wall thickness, or 0 if the cuboid is solid.

Constructor Detail

Cuboid

public Cuboid()
Instantiates a new cuboid with default values. This will not produce a usable cuboid, as it will have size 0.


Cuboid

public Cuboid(int x,
              int y,
              int z)
Instantiates a new cuboid with size values.

Parameters:
x - the cuboid's width
y - the cuboid's height
z - the cuboid's depth

Cuboid

public Cuboid(int x,
              int y,
              int z,
              int t)
Instantiates a new cuboid with size and thickness values.

Parameters:
x - the cuboid's width
y - the cuboid's height
z - the cuboid's depth
t - the cuboid's wall thickness

Cuboid

public Cuboid(int offX,
              int offY,
              int offZ,
              int x,
              int y,
              int z)
Instantiates a new cuboid with size and offset values.

Parameters:
offX - the x offset from chunk origin
offY - the y offset from chunk origin
offZ - the z offset from chunk origin
x - the cuboid's width
y - the cuboid's height
z - the cuboid's depth

Cuboid

public Cuboid(int offX,
              int offY,
              int offZ,
              int x,
              int y,
              int z,
              int t)
Instantiates a new cuboid with all values.

Parameters:
offX - the x offset from chunk origin
offY - the y offset from chunk origin
offZ - the z offset from chunk origin
x - the cuboid's width
y - the cuboid's height
z - the cuboid's depth
t - the cuboid's wall thickness
Method Detail

isSolid

public boolean isSolid()
Checks if the cuboid is solid.

Returns:
true, if the cuboid is solid

getThickness

private int getThickness()
Gets the cuboid's wall thickness.

Returns:
the thickness

getOffsetX

public int getOffsetX()
Gets the x offset from chunk origin.

Returns:
the x offset

getOffsetY

public int getOffsetY()
Gets the y offset from chunk origin.

Returns:
the y offset

getOffsetZ

public int getOffsetZ()
Gets the z offset from chunk origin

Returns:
the z offset

getOffsetLocation

public org.bukkit.Location getOffsetLocation()
Gets the offset as a location.

Returns:
the offset location

getSizeX

public int getSizeX()
Gets the cuboid's width.

Returns:
the width

getSizeY

public int getSizeY()
Gets the cuboid's height.

Returns:
the height

getSizeZ

public int getSizeZ()
Gets the cuboid's depth.

Returns:
the depth