Class MasterHex

java.lang.Object
net.sf.colossus.variant.Hex
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 Details

    • 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 String[] baseExitLabel
    • terrain

      private final MasterBoardTerrain terrain
  • Constructor Details

  • Method Details

    • getTerrain

      public MasterBoardTerrain getTerrain()
    • getTerrainName

      public String getTerrainName()
      Specified by:
      getTerrainName in class Hex
    • getTerrainDisplayName

      public String getTerrainDisplayName()
    • getTerrainColor

      public Color getTerrainColor()
    • getNeighbor

      public MasterHex getNeighbor(int i)
    • setNeighbor

      void setNeighbor(int i, MasterHex hex)
    • getLabelSide

      public int getLabelSide()
    • findDirectionForEntrySide

      public int findDirectionForEntrySide(EntrySide wantedEntrySide)
      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

      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 String getBaseExitLabel(int i)
    • setBaseExitLabel

      public void setBaseExitLabel(int i, String label)
    • getEntranceType

      public Constants.HexsideGates getEntranceType(int i)
    • setEntranceType

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