net.sf.freecol.server.generator
Class TerrainGenerator

java.lang.Object
  extended by net.sf.freecol.server.generator.TerrainGenerator

public class TerrainGenerator
extends java.lang.Object

Class for making a Map based upon a land map.


Field Summary
static int LAND_REGION_MAX_SIZE
           
static int LAND_REGION_MIN_SCORE
           
static int LAND_REGIONS_SCORE_VALUE
           
static int PACIFIC_SCORE_VALUE
           
 
Constructor Summary
TerrainGenerator(MapGeneratorOptions mapGeneratorOptions, java.util.Random random)
          Creates a new TerrainGenerator.
 
Method Summary
 void createMap(Game game, boolean[][] landMap)
          Creates a Map for the given Game.
 void createMap(Game game, Game importGame, boolean[][] landMap)
          Creates a Map for the given Game.
static void determineHighSeas(Map map, int distToLandFromHighSeas, int maxDistanceToEdge)
          Places "high seas"-tiles on the border of the given map.
static void encodeStyle(Tile tile)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAND_REGIONS_SCORE_VALUE

public static final int LAND_REGIONS_SCORE_VALUE
See Also:
Constant Field Values

LAND_REGION_MIN_SCORE

public static final int LAND_REGION_MIN_SCORE
See Also:
Constant Field Values

PACIFIC_SCORE_VALUE

public static final int PACIFIC_SCORE_VALUE
See Also:
Constant Field Values

LAND_REGION_MAX_SIZE

public static final int LAND_REGION_MAX_SIZE
See Also:
Constant Field Values
Constructor Detail

TerrainGenerator

public TerrainGenerator(MapGeneratorOptions mapGeneratorOptions,
                        java.util.Random random)
Creates a new TerrainGenerator.

See Also:
createMap(net.sf.freecol.common.model.Game, boolean[][])
Method Detail

createMap

public void createMap(Game game,
                      boolean[][] landMap)
Creates a Map for the given Game. The Map is added to the Game after it is created.

Parameters:
game - The game.
landMap - Determines whether there should be land or ocean on a given tile. This array also specifies the size of the map that is going to be created.
See Also:
Map

createMap

public void createMap(Game game,
                      Game importGame,
                      boolean[][] landMap)
Creates a Map for the given Game. The Map is added to the Game after it is created.

Parameters:
game - The game.
importGame - The game to import information form.
landMap - Determines whether there should be land or ocean on a given tile. This array also specifies the size of the map that is going to be created.
See Also:
Map

encodeStyle

public static void encodeStyle(Tile tile)

determineHighSeas

public static void determineHighSeas(Map map,
                                     int distToLandFromHighSeas,
                                     int maxDistanceToEdge)
Places "high seas"-tiles on the border of the given map. All other tiles previously of type High Seas will be set to Ocean.

Parameters:
map - The Map to create high seas on.
distToLandFromHighSeas - The distance between the land and the high seas (given in tiles).
maxDistanceToEdge - The maximum distance a high sea tile can have from the edge of the map.