Enum Class BuildingType
- All Implemented Interfaces:
Serializable,Comparable<BuildingType>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintintThe highest Construction Factor a building of this type may be built with.intThe lowest Construction Factor a building of this type is built with.static BuildingTypegetType(int ordinal) inttoString()static BuildingTypeReturns the enum constant of this class with the specified name.static BuildingType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
-
LIGHT
-
MEDIUM
-
HEAVY
-
HARDENED
-
WALL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getDefaultCF
public int getDefaultCF()- Returns:
- the Construction Factor a hex of this building is assumed to have when the board does not say otherwise: 15, 40, 90 and 120 for light, medium, heavy and hardened (Total Warfare, p. 168)
-
getMinimumCF
public int getMinimumCF()The lowest Construction Factor a building of this type is built with.Together with
getMaximumCF()this is the band the type covers, from Total Warfare, p. 168 (Building Type/Original CF). Damage takes a building below its band without making it a different type of building, so this describes what one is built to, not what it must currently stand at.- Returns:
- the lowest Construction Factor for this type, or
-1when the type is not known
-
getMaximumCF
public int getMaximumCF()The highest Construction Factor a building of this type may be built with.Each type covers a band of Construction Factors rather than a single value - light 1-15, medium 16-40, heavy 41-90 and hardened 91-150 (Total Warfare, p. 168, Building Type/Original CF). A building stronger than its band is not that type of building; it is the next type up. Damage takes a building below its band, so this bounds what a building may be built or repaired to, not what it may currently stand at.
Walls are not in that table. They are treated as hardened here, being the sturdiest thing the table describes.
- Returns:
- the highest Construction Factor for this type, or
-1when the type is not known
-
getTypeValue
public int getTypeValue() -
getType
-
toString
- Overrides:
toStringin classEnum<BuildingType>
-