net.sf.colossus.variant
Class Hex

java.lang.Object
  extended by 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

Field Summary
private  java.lang.String label
           
private  int xCoord
           
private  int yCoord
           
 
Constructor Summary
Hex(java.lang.String label, int xCoord, int yCoord)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          We consider two hexes equal if their x/y coordinates are the same.
 java.lang.String getDescription()
           
 java.lang.String getLabel()
           
abstract  java.lang.String getTerrainName()
           
 int getXCoord()
           
 int getYCoord()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

label

private final java.lang.String label

xCoord

private final int xCoord

yCoord

private final int yCoord
Constructor Detail

Hex

public Hex(java.lang.String label,
           int xCoord,
           int yCoord)
Method Detail

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