net.sf.colossus.variant
Class MasterHex

java.lang.Object
  extended by net.sf.colossus.variant.Hex
      extended by net.sf.colossus.variant.MasterHex

public class MasterHex
extends Hex

Class MasterHex describes one Masterboard hex, without GUI info.

Author:
David Ripton, Romain Dolbeau

Field Summary
private  java.lang.String[] baseExitLabel
           
private  Constants.HexsideGates[] baseExitType
          TODO these base exit types and labels are somehow used only during setup of the MasterBoard, no real need to keep them around.
private  Constants.HexsideGates[] entranceType
           
private  Constants.HexsideGates[] exitType
           
private  int labelSide
           
private  MasterHex[] neighbors
           
private  MasterBoardTerrain terrain
           
 
Constructor Summary
MasterHex(java.lang.String label, MasterBoardTerrain terrain, int xCoord, int yCoord)
           
 
Method Summary
 java.lang.String getBaseExitLabel(int i)
           
 Constants.HexsideGates getBaseExitType(int i)
           
 Constants.HexsideGates getEntranceType(int i)
           
 Constants.HexsideGates getExitType(int i)
           
 int getLabelSide()
           
 MasterHex getNeighbor(int i)
           
 MasterBoardTerrain getTerrain()
           
 java.awt.Color getTerrainColor()
           
 java.lang.String getTerrainDisplayName()
           
 java.lang.String getTerrainName()
           
 void setBaseExitLabel(int i, java.lang.String label)
           
 void setBaseExitType(int i, Constants.HexsideGates exitType)
           
 void setEntranceType(int i, Constants.HexsideGates entranceType)
           
 void setExitType(int i, Constants.HexsideGates exitType)
           
 void setLabelSide(int labelSide)
           
(package private)  void setNeighbor(int i, MasterHex hex)
           
 
Methods inherited from class net.sf.colossus.variant.Hex
equals, getDescription, getLabel, getXCoord, getYCoord, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

neighbors

private final MasterHex[] neighbors

labelSide

private int labelSide

exitType

private final Constants.HexsideGates[] exitType

entranceType

private final Constants.HexsideGates[] entranceType

baseExitType

private final Constants.HexsideGates[] baseExitType
TODO these base exit types and labels are somehow used only during setup of the MasterBoard, no real need to keep them around. It seems to be related to the fact that the master board hexes are really triangles and stored as such in the XML files. Maybe they should not be hexes in the code either.


baseExitLabel

private final java.lang.String[] baseExitLabel

terrain

private final MasterBoardTerrain terrain
Constructor Detail

MasterHex

public MasterHex(java.lang.String label,
                 MasterBoardTerrain terrain,
                 int xCoord,
                 int yCoord)
Method Detail

getTerrain

public MasterBoardTerrain getTerrain()

getTerrainName

public java.lang.String getTerrainName()
Specified by:
getTerrainName in class Hex

getTerrainDisplayName

public java.lang.String getTerrainDisplayName()

getTerrainColor

public java.awt.Color getTerrainColor()

getNeighbor

public MasterHex getNeighbor(int i)

setNeighbor

void setNeighbor(int i,
                 MasterHex hex)

getLabelSide

public int getLabelSide()

setLabelSide

public void setLabelSide(int labelSide)

getExitType

public Constants.HexsideGates getExitType(int i)

setExitType

public void setExitType(int i,
                        Constants.HexsideGates exitType)

getBaseExitType

public Constants.HexsideGates getBaseExitType(int i)

setBaseExitType

public void setBaseExitType(int i,
                            Constants.HexsideGates exitType)

getBaseExitLabel

public java.lang.String getBaseExitLabel(int i)

setBaseExitLabel

public void setBaseExitLabel(int i,
                             java.lang.String label)

getEntranceType

public Constants.HexsideGates getEntranceType(int i)

setEntranceType

public void setEntranceType(int i,
                            Constants.HexsideGates entranceType)