Package net.sf.colossus.variant
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 Color
private final String
The name displayed on the Masterboard.private final BattleHex[]
private Map
<HazardTerrain, Integer> private Map
<HazardHexside, Integer> private final String
The (unique) identifier of this terrain.private final boolean
Whether this terrain uses another Terrain recruit tree.private boolean
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.private static final Logger
(package private) IRecruiting
The recruiting tree of this terrainTODO this should be a List... private String
Subtitle, 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 TypeMethodDescriptionvoid
int
boolean
getColor()
getEntrance
(EntrySide entrySide) int
getHazardCount
(HazardTerrain terrain) int
getHazardHexsideCount
(HazardHexside hazard) int
getHazardSideCount
(char hazardSide) getHexByLabel
(String label) Look for the Hex matching the Label in this terrain.getId()
int
hashCode()
boolean
hasNativeCombatBonus
(CreatureType creature) boolean
boolean
isAlias()
boolean
isTower()
void
setHazardNumberMap
(Map<HazardTerrain, Integer> hazardNumberMap) void
setHazardSideNumberMap
(Map<Character, Integer> hazardSideNumberMap) void
setHexsideHazardNumberMap
(Map<HazardHexside, Integer> hexsideHazardNumberMap) void
void
setStartList
(List<String> startList) void
void
setTower
(boolean isTower) private void
private void
private void
Add terrain, hexsides, elevation, and exits to hexes.private void
Add 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
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 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
Look for the Hex matching the Label in this terrain. -
setRecruitingSubTree
-
getRecruitingSubTree
-
compareTo
- Specified by:
compareTo
in 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
public int hashCode() -
equals
-