rl.common.mapping
Class HexMap

java.lang.Object
  extended by rl.common.mapping.Map
      extended by rl.common.mapping.HexMap
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CenturionMap, LeviathanMap

public abstract class HexMap
extends Map

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class rl.common.mapping.Map
Map.Edge
 
Field Summary
(package private) static long serialVersionUID
           
 
Constructor Summary
  HexMap()
           
protected HexMap(int Width, int Height)
           
 
Method Summary
 MapHex getHex(Coordinate coord)
           
 MapHex getHex(int Index)
           
 MapHex getHex(int x, int y)
           
 int getHexCount()
           
 MapHex getHexInDirection(Coordinate c, int direction)
          Code from Megamek Gets the hex in the specified direction from the specified starting coordinates.
 MapHex getHexInDirection(int x, int y, int direction)
          Code from Megamek Gets the hex in the specified direction from the specified starting coordinates.
protected  int indexFor(java.lang.String hexNum)
           
 boolean isValidGameBoard()
           
protected abstract  void setDefaultHex(java.lang.String DefaultTerrain)
           
 void setHex(int Column, int Row, MapHex Hex)
           
 void setHex(int Index, MapHex Hex)
           
 void setHex(java.lang.String Index, MapHex Hex)
           
abstract  void setSize(int Width, int Height)
           
 java.lang.String toString()
           
 
Methods inherited from class rl.common.mapping.Map
getHeight, getMapType, getName, getWidth, loadFromFile, saveToFile, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

HexMap

public HexMap()

HexMap

protected HexMap(int Width,
                 int Height)
Method Detail

getHex

public MapHex getHex(int Index)

getHex

public MapHex getHex(int x,
                     int y)

getHex

public MapHex getHex(Coordinate coord)

getHexCount

public int getHexCount()

setHex

public void setHex(int Index,
                   MapHex Hex)

setHex

public void setHex(java.lang.String Index,
                   MapHex Hex)

setHex

public void setHex(int Column,
                   int Row,
                   MapHex Hex)

setSize

public abstract void setSize(int Width,
                             int Height)
                      throws java.lang.Exception
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isValidGameBoard

public boolean isValidGameBoard()

indexFor

protected int indexFor(java.lang.String hexNum)

getHexInDirection

public MapHex getHexInDirection(Coordinate c,
                                int direction)
Code from Megamek Gets the hex in the specified direction from the specified starting coordinates.


getHexInDirection

public MapHex getHexInDirection(int x,
                                int y,
                                int direction)
Code from Megamek Gets the hex in the specified direction from the specified starting coordinates. Avoids calls to Coords.translated, and thus, object construction.


setDefaultHex

protected abstract void setDefaultHex(java.lang.String DefaultTerrain)