Enum Class CrewType

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

public enum CrewType extends Enum<CrewType>
Contains data used by crew to determine how many distinct crew members to track for name, damage, and skills, and which crew normally execute which roles. Note that this applies to various special multi-crew cockpits in which crew members can take over duties of another that has been incapacitated; units with multiple crew that do not track them separately (such as vehicles and aerospace vessels) still use the SINGLE value, since they do not track damage to individual crew members (outside specific criticalSlots) and only have a single set of skills.
  • Enum Constant Details

    • SINGLE

      public static final CrewType SINGLE
    • CREW

      public static final CrewType CREW
    • VESSEL

      public static final CrewType VESSEL
    • TRIPOD

      public static final CrewType TRIPOD
    • SUPERHEAVY_TRIPOD

      public static final CrewType SUPERHEAVY_TRIPOD
    • QUADVEE

      public static final CrewType QUADVEE
    • DUAL

      public static final CrewType DUAL
    • COMMAND_CONSOLE

      public static final CrewType COMMAND_CONSOLE
    • INFANTRY_CREW

      public static final CrewType INFANTRY_CREW
    • BUILDING

      public static final CrewType BUILDING
    • NONE

      public static final CrewType NONE
  • Method Details

    • values

      public static CrewType[] 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 CrewType 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
    • getCrewSlots

      public int getCrewSlots()
      Returns:
      The number of distinct crew members in the cockpit.
    • getRoleName

      public String getRoleName(int index)
      Parameters:
      index - The index of the crew member in question.
      Returns:
      A name that designates the role played by that crew member.
    • getPilotPos

      public int getPilotPos()
      Returns:
      The index of the crew member that typically acts in the role of pilot.
    • getGunnerPos

      public int getGunnerPos()
      Returns:
      The index of the crew member that typically acts in the role of gunner.
    • getCommanderPos

      @Deprecated(since="0.51.0", forRemoval=true) public int getCommanderPos()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The index of the crew member that that provides a command bonus. A value < 0 indicates there is no such position.
    • getTechPos

      public int getTechPos()
      Returns:
      The index of the crew member that that acts as a technical/tactical officer. A value < 0 indicates there is no such position.
    • getMaxPrimaryTargets

      public int getMaxPrimaryTargets()
      Returns:
      The number of targets that can be attacked without incurring a secondary target penalty with a dedicated gunner. A value < 0 indicates that there is no limit.