Enum Class BuildingType

java.lang.Object
java.lang.Enum<BuildingType>
megamek.common.enums.BuildingType
All Implemented Interfaces:
Serializable, Comparable<BuildingType>, Constable

public enum BuildingType extends Enum<BuildingType>
  • Enum Constant Details

  • Method Details

    • values

      public static BuildingType[] 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

      public static BuildingType valueOf(String name)
      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 name
      NullPointerException - 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 -1 when 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 -1 when the type is not known
    • getTypeValue

      public int getTypeValue()
    • getType

      public static BuildingType getType(int ordinal)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<BuildingType>