jurpe.dungeon.rpgmap
Class MapTiles

java.lang.Object
  extended by jurpe.dungeon.rpgmap.MapTiles
All Implemented Interfaces:
java.io.Serializable

public class MapTiles
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
MapTiles(short width, short height)
          Constructor
 
Method Summary
 boolean areAllVisitedCells()
          Returns true if all cells in the map were visited
 Cell getCell(HexPoint p)
          Get a MapCell in p point hexagon coordinates
 Cell getCell(short x, short y)
          Get a cell
 short getHeight()
          Height of RpgMap in Hexagons
 Cell getRandomCell(java.util.Random rndgen)
          Get a random RpgMapCell
 short getWidth()
          Width of RpgMap in Hexagons
 boolean isInside(RpgMapPoint position)
          Returns true if the position is inside the RpgMap width and height
 boolean isInside(short x, short y)
          Returns true if the position is inside the RpgMap width and height
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapTiles

public MapTiles(short width,
                short height)
Constructor

Parameters:
width - map width
height - map height
Method Detail

getCell

public Cell getCell(short x,
                    short y)
Get a cell

Parameters:
x - X coordinate of cell
y - Y coordinate of cell
Returns:
Wanted cell

getCell

public Cell getCell(HexPoint p)
Get a MapCell in p point hexagon coordinates

Parameters:
p - Point coordinates of hexagon
Returns:
RpgMapCell in p point coordinates

getWidth

public short getWidth()
Width of RpgMap in Hexagons

Returns:
Width of RpgMap in Hexagons

getHeight

public short getHeight()
Height of RpgMap in Hexagons

Returns:
Height of RpgMap in Hexagons

getRandomCell

public Cell getRandomCell(java.util.Random rndgen)
Get a random RpgMapCell

Parameters:
rndgen - Random seed
Returns:
A random RpgMapCell (coordinates 0-(sizeX-2) and 0-(sizeY-2))

isInside

public boolean isInside(RpgMapPoint position)
Returns true if the position is inside the RpgMap width and height

Parameters:
position - Point coordinates of an hexagon
Returns:
True if the position is inside the RpgMap width and height

isInside

public boolean isInside(short x,
                        short y)
Returns true if the position is inside the RpgMap width and height

Parameters:
x - X coordinate of an hexagon
y - Y coordinate of an hexagon
Returns:
True if the position is inside the RpgMap width and height

areAllVisitedCells

public boolean areAllVisitedCells()
Returns true if all cells in the map were visited

Returns:
true if all cells in the map were visited

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net