com.devnullsoftware.javaterrain
Class Map

java.lang.Object
  |
  +--com.devnullsoftware.javaterrain.Map

public class Map
extends java.lang.Object
implements java.io.Serializable, java.lang.Runnable

The Map class consists of a collection of hexes and contains routines to generate elevation, terrain, temperatures, pressures, winds, rainfall, climate, and much more.

See Also:
Serialized Form

Field Summary
static int iNumSeasons
          Number of Seasons in a year for this world.
 MapParams pParams
           
 
Constructor Summary
(package private) Map(MapParams pParams)
          Constructor which allocates a map with the passed in dimensions.
 
Method Summary
 void assignGoodies()
           
 void createRivers()
           
static Map createWorld(MapParams pParams)
          This function drives the map generator.
 void findShorelines()
           
 void generateWorld()
           
 int getDimension()
           
 float getElevation(int x, int y)
           
 float getElevationDeepOcean()
           
 float getElevationHighest()
           
 float getElevationImpassableMountains()
           
 float getElevationLowest()
           
 float getElevationMountains()
           
 float getElevationOcean()
           
 Hex getHex(int i)
           
 Hex getHex(int x, int y)
           
 java.lang.String getName()
           
 MapParams getParams()
           
static void output(java.lang.String out)
           
 void reCreateWorld()
           
 void run()
           
 void setElevation(int x, int y, float fElevation)
           
 void setName(java.lang.String sName)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iNumSeasons

public static final int iNumSeasons
Number of Seasons in a year for this world. Always 4.

pParams

public MapParams pParams
Constructor Detail

Map

Map(MapParams pParams)
Constructor which allocates a map with the passed in dimensions. Note the the resultant map is always square.
Parameters:
pParams - the MapParameters to be used for this map's generation
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()

setName

public void setName(java.lang.String sName)

getDimension

public int getDimension()

getHex

public Hex getHex(int x,
                  int y)

getHex

public Hex getHex(int i)

getParams

public MapParams getParams()

getElevationHighest

public float getElevationHighest()

getElevationLowest

public float getElevationLowest()

getElevationDeepOcean

public float getElevationDeepOcean()

getElevationOcean

public float getElevationOcean()

getElevationMountains

public float getElevationMountains()

getElevationImpassableMountains

public float getElevationImpassableMountains()

getElevation

public float getElevation(int x,
                          int y)
                   throws java.lang.NullPointerException

setElevation

public void setElevation(int x,
                         int y,
                         float fElevation)
                  throws java.lang.NullPointerException

createRivers

public void createRivers()

findShorelines

public void findShorelines()

assignGoodies

public void assignGoodies()

reCreateWorld

public void reCreateWorld()

createWorld

public static Map createWorld(MapParams pParams)
This function drives the map generator.

output

public static void output(java.lang.String out)

generateWorld

public void generateWorld()

start

public void start()

stop

public void stop()

run

public void run()
Specified by:
run in interface java.lang.Runnable