Class MasterHex
java.lang.Object
net.sf.colossus.variant.Hex
net.sf.colossus.variant.MasterHex
Class MasterHex describes one Masterboard hex, without GUI info.
- Author:
- David Ripton, Romain Dolbeau
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]private final Constants.HexsideGates[]TODO these base exit types and labels are somehow used only during setup of the MasterBoard, no real need to keep them around.private final Constants.HexsideGates[]private final Constants.HexsideGates[]private intprivate final MasterHex[]private final MasterBoardTerrain -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfindDirectionForEntrySide(EntrySide wantedEntrySide) For a given EntrySide, find out which direction that means.getBaseExitLabel(int i) getBaseExitType(int i) getEntranceType(int i) getExitType(int i) intgetNeighbor(int i) voidsetBaseExitLabel(int i, String label) voidsetBaseExitType(int i, Constants.HexsideGates exitType) voidsetEntranceType(int i, Constants.HexsideGates entranceType) voidsetExitType(int i, Constants.HexsideGates exitType) voidsetLabelSide(int labelSide) (package private) voidsetNeighbor(int i, MasterHex hex)
-
Field Details
-
neighbors
-
labelSide
private int labelSide -
exitType
-
entranceType
-
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
-
terrain
-
-
Constructor Details
-
MasterHex
-
-
Method Details
-
getTerrain
-
getTerrainName
- Specified by:
getTerrainNamein classHex
-
getTerrainDisplayName
-
getTerrainColor
-
getNeighbor
-
setNeighbor
-
getLabelSide
public int getLabelSide() -
findDirectionForEntrySide
For a given EntrySide, find out which direction that means. Caller can use that e.g. to figure out what is the neighbor hex from where an attacker is coming TODO should this rather be somewhere else? Since it uses entryside, it makes variant package depending on game package ...- Parameters:
wantedEntrySide-- Returns:
- The direction towards which that entryside is placed
-
setLabelSide
public void setLabelSide(int labelSide) -
getExitType
-
setExitType
-
getBaseExitType
-
setBaseExitType
-
getBaseExitLabel
-
setBaseExitLabel
-
getEntranceType
-
setEntranceType
-