Class MasterBoardTerrain

java.lang.Object
net.sf.colossus.variant.MasterBoardTerrain
All Implemented Interfaces:
Comparable<MasterBoardTerrain>

public class MasterBoardTerrain extends Object implements Comparable<MasterBoardTerrain>
A master board terrain. This class describes a terrain on the master board, including its name, color and the layout of a generic battle land. It can occur multiple times on a master board layout attached to the MasterHex class. Battle land information could probably split out into another class, which could then be immutable.
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • id

      private final String id
      The (unique) identifier of this terrain. Should also be used for all Battlelands purpose.
    • displayName

      private final String displayName
      The name displayed on the Masterboard. Should also be used for all recruiting purpose. WARNING: this is not done that way yet. It shoud be, so that a single name on the Masterboard will represent a single recruiting branch, even if it' backed by several different Battlelands. This would also remove a lot of duplicated entries in the Full Recruit Tree. WIP. ADDITIONAL WARNING: What about variant such as Balrog? The recruitment is Hex-specific, not Terrain-specific...
    • subtitle

      private String subtitle
      Subtitle, for the Battlelands. Cosmetic only, but nice
    • color

      private final Color color
    • startList

      private List<String> startList
      TODO this should be a List ... or a List ??? If non-null, this is the list of hexes a defending legion will start in, in a similar way to the Tower in the Default variant.
    • isTower

      private boolean isTower
      Whether this is a Tower-like building, with regards to starting the game, not recruiting or defender entering in a non-default location on the Battlemap.
    • hazardNumberMap

      private Map<HazardTerrain,Integer> hazardNumberMap
    • hazardSideNumberMap

      private Map<Character,Integer> hazardSideNumberMap
    • hexsideHazardNumberMap

      private Map<HazardHexside,Integer> hexsideHazardNumberMap
    • aliases

      private final Set<MasterBoardTerrain> aliases
      The other MasterBoardTerrain using the same recruit tree
    • isAlias

      private final boolean isAlias
      Whether this terrain uses another Terrain recruit tree.
    • battleHexes

      private final BattleHex[][] battleHexes
    • entrances

      private final BattleHex[] entrances
    • recruitingSubTree

      IRecruiting recruitingSubTree
      The recruiting tree of this terrain
  • Constructor Details

    • MasterBoardTerrain

      public MasterBoardTerrain(String id, String displayName, Color color, boolean isAlias)
    • MasterBoardTerrain

      public MasterBoardTerrain(String id, String displayName, Color color)
  • Method Details

    • setupHexArrays

      private void setupHexArrays()
    • setupEntrances

      private void setupEntrances()
    • setupNeighbors

      private void setupNeighbors()
      Add references to neighbor hexes.
    • getEntrance

      public BattleHex getEntrance(EntrySide entrySide)
    • setupHexesGameState

      private void setupHexesGameState()
      Add terrain, hexsides, elevation, and exits to hexes. Cliffs are bidirectional; other hexside obstacles are noted only on the high side, since they only interfere with uphill movement.
    • getHexByLabel

      public BattleHex getHexByLabel(String label)
      Look for the Hex matching the Label in this terrain.
    • setRecruitingSubTree

      public void setRecruitingSubTree(IRecruiting rst)
    • getRecruitingSubTree

      public IRecruiting getRecruitingSubTree()
    • compareTo

      public int compareTo(MasterBoardTerrain m)
      Specified by:
      compareTo in interface Comparable<MasterBoardTerrain>
    • addAlias

      public void addAlias(MasterBoardTerrain t)
    • isAlias

      public boolean isAlias()
    • getAliases

      public Set<MasterBoardTerrain> getAliases()
    • getId

      public String getId()
    • getDisplayName

      public String getDisplayName()
    • getSubtitle

      public String getSubtitle()
    • setSubtitle

      public void setSubtitle(String s)
    • getColor

      public Color getColor()
    • hasNativeCombatBonus

      public boolean hasNativeCombatBonus(CreatureType creature)
    • setStartList

      public void setStartList(List<String> startList)
    • getStartList

      public List<String> getStartList()
    • setTower

      public void setTower(boolean isTower)
    • isTower

      public boolean isTower()
    • hasStartList

      public boolean hasStartList()
    • setHazardNumberMap

      public void setHazardNumberMap(Map<HazardTerrain,Integer> hazardNumberMap)
    • getHazardCount

      public int getHazardCount(HazardTerrain terrain)
    • setHazardSideNumberMap

      public void setHazardSideNumberMap(Map<Character,Integer> hazardSideNumberMap)
    • getHazardSideCount

      public int getHazardSideCount(char hazardSide)
    • setHexsideHazardNumberMap

      public void setHexsideHazardNumberMap(Map<HazardHexside,Integer> hexsideHazardNumberMap)
    • getHazardHexsideCount

      public int getHazardHexsideCount(HazardHexside hazard)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object