net.sf.colossus.variant
Class Hex
java.lang.Object
net.sf.colossus.variant.Hex
- Direct Known Subclasses:
- BattleHex, MasterHex
public abstract class Hex
- extends java.lang.Object
Class Hex describes one general hex.
- Author:
- David Ripton
Constructor Summary |
Hex(java.lang.String label,
int xCoord,
int yCoord)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
label
private final java.lang.String label
xCoord
private final int xCoord
yCoord
private final int yCoord
Hex
public Hex(java.lang.String label,
int xCoord,
int yCoord)
getLabel
public java.lang.String getLabel()
getTerrainName
public abstract java.lang.String getTerrainName()
getDescription
public java.lang.String getDescription()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getXCoord
public int getXCoord()
getYCoord
public int getYCoord()
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- We consider two hexes equal if their x/y coordinates are the same.
This gives equality within the context of a HexMap, since we don't know to
which map the Hex belongs we can't do any better.
- Overrides:
equals
in class java.lang.Object