Enum Class PrisonerCaptureStyle
- All Implemented Interfaces:
Serializable,Comparable<PrisonerCaptureStyle>,Constable
Defines the available styles for handling prisoner capture.
The PrisonerCaptureStyle enumeration specifies how prisoners are captured during a
campaign. The styles include:
NONE- No capture mechanics are applied.CAMPAIGN_OPERATIONS- Capture mechanics follow the Campaign Operations rules.MEKHQ- Capture mechanics follow MekHQ-specific rules.
This enumeration provides utility methods for interaction, including fetching labels and tooltips for display purposes and helper methods to identify the capture style.
-
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 TypeMethodDescriptionstatic PrisonerCaptureStylefromString(String text) Converts the specified string into its correspondingPrisonerCaptureStyleenum value.getLabel()booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanisMekHQ()Determines if the current capture style isMEKHQ.booleanisNone()Determines if the current capture style isNONE.toString()Converts the capture style to a localized label for display.static PrisonerCaptureStyleReturns the enum constant of this class with the specified name.static PrisonerCaptureStyle[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
CAMPAIGN_OPERATIONS
-
MEKHQ
-
-
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
-
getLabel
-
getTooltip
-
isNone
public boolean isNone()Determines if the current capture style isNONE.- Returns:
trueif the current style isNONE, otherwisefalse.
-
isCampaignOperations
Deprecated, for removal: This API element is subject to removal in a future version.Determines if the current capture style isCAMPAIGN_OPERATIONS.- Returns:
trueif the current style isCAMPAIGN_OPERATIONS, otherwisefalse.
-
isMekHQ
public boolean isMekHQ()Determines if the current capture style isMEKHQ.- Returns:
trueif the current style isMEKHQ, otherwisefalse.
-
fromString
Converts the specified string into its correspondingPrisonerCaptureStyleenum value. The method attempts to interpret the string as either the name of an enum constant or an ordinal value of the enum. If the conversion fails, the method logs an error and returns the default valueNONE.- Parameters:
text- the string to be converted into aPrisonerCaptureStyleenum value. It can be the name of the enum constant or its ordinal value as a string.- Returns:
- the corresponding
PrisonerCaptureStyleenum constant if the string matches a name or ordinal value, otherwiseNONE.
-
toString
Converts the capture style to a localized label for display.This method overrides the default
toString()implementation to return the label representation of the capture style instead of its name.- Overrides:
toStringin classEnum<PrisonerCaptureStyle>- Returns:
- A
Stringcontaining the localized label of the capture style.
-