Class MasterHex


  • public class MasterHex
    extends Hex
    Class MasterHex describes one Masterboard hex, without GUI info.
    Author:
    David Ripton, Romain Dolbeau
    • Field Detail

      • neighbors

        private final MasterHex[] neighbors
      • labelSide

        private int labelSide
      • 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
    • Constructor Detail

      • MasterHex

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

      • 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()
      • 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)
      • getBaseExitLabel

        public java.lang.String getBaseExitLabel​(int i)
      • setBaseExitLabel

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