jurpe.dungeon.hexmap
Class HexMapView

java.lang.Object
  extended by jurpe.dungeon.hexmap.HexMapView

public class HexMapView
extends java.lang.Object

The HexMapView class offers methods related to HexMap and RpgMap classes.


Constructor Summary
HexMapView(HexMap sHexMap, RpgMap sRpgMap)
           
 
Method Summary
 RpgMapPoint getDisplayableCenter()
          Get the coordinates of the center in the view map as a RgpMapCell
 Cell getDisplayableEmptyRandomCell(java.util.Random rnd, boolean nextToCenter)
          Get a random cell in this map.
 Drawer getDrawer()
          Handle to Map drawer tool
 HexMap getHexMap()
          Get the HexMap control to show this view
 MapView getMapView()
          Get Map View
 RpgMapPoint getRandomDisplayablePoint(java.util.Random rndgen)
          Get a random RpgMapPoint inside RpgMapView
 RpgMap getRpgMap()
          Get the RpgMap associated to this view
 boolean isOnTheEdge(RpgMapPoint p)
          Return true if the point is over the edge of this view.
 void reloadRpgMap(RpgMap map)
          Reload RpgMap into the HexMapView
 java.lang.String toString()
          ToString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HexMapView

public HexMapView(HexMap sHexMap,
                  RpgMap sRpgMap)
Parameters:
sHexMap - HexMap
sRpgMap - RpgMap
Method Detail

getRpgMap

public RpgMap getRpgMap()
Get the RpgMap associated to this view

Returns:
RpgMap

reloadRpgMap

public void reloadRpgMap(RpgMap map)
Reload RpgMap into the HexMapView

Parameters:
map -

getHexMap

public HexMap getHexMap()
Get the HexMap control to show this view

Returns:
HexMap

getDrawer

public Drawer getDrawer()
Handle to Map drawer tool

Returns:
Handle to Map drawer tool

getRandomDisplayablePoint

public RpgMapPoint getRandomDisplayablePoint(java.util.Random rndgen)
Get a random RpgMapPoint inside RpgMapView

Parameters:
rndgen - Random seed
Returns:
A random RpgMapCell inside the displayable view

getDisplayableEmptyRandomCell

public Cell getDisplayableEmptyRandomCell(java.util.Random rnd,
                                          boolean nextToCenter)
Get a random cell in this map. This cell cannot be where already is a wall or a special.

Parameters:
rnd - Random generator
nextToCenter - if true, it will try to return a cell next to the center of the dungeon
Returns:
null if no cell is found. Else return the wanted cell

getDisplayableCenter

public RpgMapPoint getDisplayableCenter()
Get the coordinates of the center in the view map as a RgpMapCell

Returns:
RpgMapPoint Coordinates of the center in the viewmap;

getMapView

public MapView getMapView()
Get Map View

Returns:

isOnTheEdge

public boolean isOnTheEdge(RpgMapPoint p)
Return true if the point is over the edge of this view.

Returns:
true if the point is over the edge of this view.

toString

public java.lang.String toString()
ToString

Overrides:
toString in class java.lang.Object

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