|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.flexgen.map.MapGenerator
public class MapGenerator
Class containing logic for randomly generating a map using a specified set of map tile types.
Constructor Summary | |
---|---|
MapGenerator(ImprovedRandom improvedRandom,
MapTileType[] mapTileTypes,
int minX,
int minY,
int maxX,
int maxY)
Construct a map generator. |
Method Summary | |
---|---|
void |
addMapTile(MapTileLocation mapTileLocation,
MapTile mapTile)
Add a map tile to the map at the specified location. |
void |
addMapTileAddedListener(MapTileAddedListener mapTileAddedListener)
Add a new listener for the event of adding a map tile to the map. |
void |
generate()
Generate the map. |
MapTile |
getMapTile(MapTileLocation mapTileLocation)
Get the map tile at a specified location. |
int |
getMaxX()
Get the largest possible X coordinate for map tiles in the map. |
int |
getMaxY()
Get the largest possible Y coordinate for map tiles in the map. |
int |
getMinX()
Get the smallest possible X coordinate for map tiles in the map. |
int |
getMinY()
Get the smallest possible Y coordinate for map tiles in the map. |
int |
getTileSize()
Get the size of the map unit array that defines the map tile types used by this map generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapGenerator(ImprovedRandom improvedRandom, MapTileType[] mapTileTypes, int minX, int minY, int maxX, int maxY)
improvedRandom
- Random number generator to use for generating the map. Cannot be null.mapTileTypes
- Array of map tile types that define the available map tile types for randomly
generating the map. Cannot be null. Must contain at least one element. No element
can be null. Cannot contain two or more elements that are identical. All map tile
types in the array must be the same size.minX
- Smallest possible X coordinate for map tiles in the map.minY
- Smallest possible Y coordinate for map tiles in the map.maxX
- Largest possible X coordinate for map tiles in the map. Must be greater than or
equal to minX.maxY
- Largest possible Y coordinate for map tiles in the map. Must be greater than or
equal to minY.Method Detail |
---|
public int getTileSize()
public int getMinX()
public int getMinY()
public int getMaxX()
public int getMaxY()
public void addMapTileAddedListener(MapTileAddedListener mapTileAddedListener)
mapTileAddedListener
- The listener to add.public MapTile getMapTile(MapTileLocation mapTileLocation)
mapTileLocation
- Location for which to get the map tile.
public void addMapTile(MapTileLocation mapTileLocation, MapTile mapTile)
mapTileLocation
- Location at which to add the map tile.mapTile
- Map tile to add.public void generate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009 - Jeffrey J. Weston <jjweston@gmail.com>
All rights reserved. Use is subject to license terms.