Package megamek.common.units
Enum Class CrewType
- All Implemented Interfaces:
Serializable,Comparable<CrewType>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.intintintintgetRoleName(int index) intstatic CrewTypeReturns the enum constant of this class with the specified name.static CrewType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SINGLE
-
CREW
-
VESSEL
-
TRIPOD
-
SUPERHEAVY_TRIPOD
-
QUADVEE
-
DUAL
-
COMMAND_CONSOLE
-
INFANTRY_CREW
-
BUILDING
-
NONE
-
-
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
-
getCrewSlots
public int getCrewSlots()- Returns:
- The number of distinct crew members in the cockpit.
-
getRoleName
- 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, 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.
-