|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.globalse.arena.sword.algorithm.World
The class World creates a world. It delivers all data of the created world.
The world is infinite. Therefore, it is divided into tiles of a fixed size. The tiles are arranged in a coordinate system, similar to pixels on a screen.
Imagine a 2-dimensional grid. The squares between the gridpoints are the tiles of the world. The gridpoints have coordinates. (0,0) is the point at the center of the grid, (1,0) is one position to the right.
To address a tile, we defined that each tile is represented by the gridpoint at its lower left corner. So the tile (0,0) is the tile that has its lower left corner at the center of the grid.
The world class is deterministic. If you create two worlds with the same parameters (which are set by the constructor), the created worlds will be exactly the same.
Constructor Summary | |
World(GameManager gameManager)
The constructor creates a new world object. |
Method Summary | |
Landscape |
getLandscape()
Returns the landscape of the world. |
double[][][] |
getLandscape(int x,
int y,
int detailLevel)
Returns the heightmap and vegetationmap of one tile. |
double[] |
getMinMax()
Returns the range in which "most" height values and vegetation values are. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public World(GameManager gameManager)
gameManager
- the seed for the random algorithmMethod Detail |
public Landscape getLandscape() throws java.lang.Exception
public double[][][] getLandscape(int x, int y, int detailLevel) throws java.lang.Exception
x
- the x-coordinates of the point at the lower left
corner of the tiley
- the y-coordinates of the point at the lower left
corner of the tiledetailLevel
- the level of the detail of the landscape.
Logarithm ofpublic double[] getMinMax()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |