Class MasterBoardTerrain
java.lang.Object
net.sf.colossus.variant.MasterBoardTerrain
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<MasterBoardTerrain> The other MasterBoardTerrain using the same recruit treeprivate final BattleHex[][]private final Colorprivate final StringThe name displayed on the Masterboard.private final BattleHex[]private Map<HazardTerrain, Integer> private Map<HazardHexside, Integer> private final StringThe (unique) identifier of this terrain.private final booleanWhether this terrain uses another Terrain recruit tree.private booleanWhether 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.private static final Logger(package private) IRecruitingThe recruiting tree of this terrainTODO this should be a List... private StringSubtitle, for the Battlelands. -
Constructor Summary
ConstructorsConstructorDescriptionMasterBoardTerrain(String id, String displayName, Color color) MasterBoardTerrain(String id, String displayName, Color color, boolean isAlias) -
Method Summary
Modifier and TypeMethodDescriptionvoidintbooleangetColor()getEntrance(EntrySide entrySide) intgetHazardCount(HazardTerrain terrain) intgetHazardHexsideCount(HazardHexside hazard) intgetHazardSideCount(char hazardSide) getHexByLabel(String label) Look for the Hex matching the Label in this terrain.getId()inthashCode()booleanhasNativeCombatBonus(CreatureType creature) booleanbooleanisAlias()booleanisTower()voidsetHazardNumberMap(Map<HazardTerrain, Integer> hazardNumberMap) voidsetHazardSideNumberMap(Map<Character, Integer> hazardSideNumberMap) voidsetHexsideHazardNumberMap(Map<HazardHexside, Integer> hexsideHazardNumberMap) voidvoidsetStartList(List<String> startList) voidvoidsetTower(boolean isTower) private voidprivate voidprivate voidAdd terrain, hexsides, elevation, and exits to hexes.private voidAdd references to neighbor hexes.
-
Field Details
-
LOGGER
-
id
The (unique) identifier of this terrain. Should also be used for all Battlelands purpose. -
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
Subtitle, for the Battlelands. Cosmetic only, but nice -
color
-
startList
-
isTower
private boolean isTowerWhether 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
-
hazardSideNumberMap
-
hexsideHazardNumberMap
-
aliases
The other MasterBoardTerrain using the same recruit tree -
isAlias
private final boolean isAliasWhether this terrain uses another Terrain recruit tree. -
battleHexes
-
entrances
-
recruitingSubTree
IRecruiting recruitingSubTreeThe recruiting tree of this terrain
-
-
Constructor Details
-
MasterBoardTerrain
-
MasterBoardTerrain
-
-
Method Details
-
setupHexArrays
private void setupHexArrays() -
setupEntrances
private void setupEntrances() -
setupNeighbors
private void setupNeighbors()Add references to neighbor hexes. -
getEntrance
-
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
-
setRecruitingSubTree
-
getRecruitingSubTree
-
compareTo
- Specified by:
compareToin interfaceComparable<MasterBoardTerrain>
-
addAlias
-
isAlias
public boolean isAlias() -
getAliases
-
getId
-
getDisplayName
-
getSubtitle
-
setSubtitle
-
getColor
-
hasNativeCombatBonus
-
setStartList
-
getStartList
-
setTower
public void setTower(boolean isTower) -
isTower
public boolean isTower() -
hasStartList
public boolean hasStartList() -
setHazardNumberMap
-
getHazardCount
-
setHazardSideNumberMap
-
getHazardSideCount
public int getHazardSideCount(char hazardSide) -
setHexsideHazardNumberMap
-
getHazardHexsideCount
-
hashCode
-
equals
-