public final class ConstantHeightMap extends AbstractHeightMap
name, seed
Constructor and Description |
---|
ConstantHeightMap(double height) |
ConstantHeightMap(java.lang.String name,
double height) |
Modifier and Type | Method and Description |
---|---|
double |
getConstantValue()
If the height map is
constant : returns the constant
value that would be returned for any location from
HeightMap.getHeight(int, int) and HeightMap.getHeight(float, float) . |
double |
getHeight() |
double |
getHeight(float x,
float y)
Get the height of the height map at a particular location.
|
double |
getHeight(int x,
int y)
Get the height of the height map at a particular location.
|
javax.swing.Icon |
getIcon()
Get a 16x16 icon representing this height map.
|
double[] |
getRange()
Get the range of this height map, i.e.
|
boolean |
isConstant()
Indicate whether the height map is constant, i.e.
|
clone, getBaseHeight, getColour, getExtent, getName, getParent, getSeed, setName, setSeed
public ConstantHeightMap(double height)
public ConstantHeightMap(java.lang.String name, double height)
public double getHeight()
public double getHeight(int x, int y)
HeightMap
getHeight
in interface HeightMap
getHeight
in class AbstractHeightMap
x
- The X coordinate of the location of which to get the height.y
- The Y coordinate of the location of which to get the height.public double getHeight(float x, float y)
HeightMap
getHeight
in interface HeightMap
getHeight
in class AbstractHeightMap
x
- The X coordinate of the location of which to get the height.y
- The Y coordinate of the location of which to get the height.public boolean isConstant()
HeightMap
isConstant
in interface HeightMap
isConstant
in class AbstractHeightMap
true
if the height map is constant.public double getConstantValue()
HeightMap
constant
: returns the constant
value that would be returned for any location from
HeightMap.getHeight(int, int)
and HeightMap.getHeight(float, float)
. If the
height map is not constant the behaviour is undefined.getConstantValue
in interface HeightMap
getConstantValue
in class AbstractHeightMap
HeightMap.isConstant()
.public javax.swing.Icon getIcon()
HeightMap
public double[] getRange()
HeightMap
HeightMap.getBaseHeight()
) and the upper bound in
index 1.