Class games.Battle.server.GeoMorph.GeoMorph
All Packages Class Hierarchy This Package Previous Next Index
Class games.Battle.server.GeoMorph.GeoMorph
java.lang.Object
|
+----games.Battle.server.GeoMorph.GeoMorph
- public class GeoMorph
- extends Object
GeoMorph creates worlds based on pre-constructed 4x4 tiles of terrain. Since
each tile has been constructed by hand, it leads to "strategically
interesting" terrain, instead of totally random terrain. Also, each tile
can only contain one city which helps keeps the cities spaced apart, and
the city goes on a particular square that "makes sense" for the particular
tile it is in.
-
WORLDSIZE
- the size of the world (in tiles) that we're going to build
-
GeoMorph(String, int)
- Construct a GeoMorph world.
-
getRandomCity()
- chooses a tile at random and returns that tile's city hint in world
co-ordinates.
-
terrain(int, int)
- return the level of terrain at a particular board location
WORLDSIZE
public int WORLDSIZE
- the size of the world (in tiles) that we're going to build
GeoMorph
public GeoMorph(String basename,
int numTiles)
- Construct a GeoMorph world. Load the tile files from the file base
given in basename, with the tile number appended onto it. Create a
world that is numTiles by numTiles in size. The tile files are loaded,
and from each tile 4 tiles are generated, one for the original
orientation and 3 for each 90 degree rotation. Mirror images are not
used.
- Parameters:
- basename - the prefix of all the tile filenames
- numTiles - the size of the world in tiles: 4 means 4x4 tiles
terrain
public int terrain(int bx,
int by)
- return the level of terrain at a particular board location
- Parameters:
- bx - the x location on the actual world
- by - the y location on the actual world
getRandomCity
public Point getRandomCity()
- chooses a tile at random and returns that tile's city hint in world
co-ordinates.
All Packages Class Hierarchy This Package Previous Next Index