Enum Class PrisonerCaptureStyle

java.lang.Object
java.lang.Enum<PrisonerCaptureStyle>
mekhq.campaign.randomEvents.prisoners.PrisonerCaptureStyle
All Implemented Interfaces:
Serializable, Comparable<PrisonerCaptureStyle>, Constable

public enum PrisonerCaptureStyle extends Enum<PrisonerCaptureStyle>
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.

  • Enum Constant Details

  • Method Details

    • values

      public static PrisonerCaptureStyle[] 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 PrisonerCaptureStyle 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
    • getLabel

      public String getLabel()
    • getTooltip

      public String getTooltip()
    • isNone

      public boolean isNone()
      Determines if the current capture style is NONE.
      Returns:
      true if the current style is NONE, otherwise false.
    • isCampaignOperations

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isCampaignOperations()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determines if the current capture style is CAMPAIGN_OPERATIONS.
      Returns:
      true if the current style is CAMPAIGN_OPERATIONS, otherwise false.
    • isMekHQ

      public boolean isMekHQ()
      Determines if the current capture style is MEKHQ.
      Returns:
      true if the current style is MEKHQ, otherwise false.
    • fromString

      public static PrisonerCaptureStyle fromString(String text)
      Converts the specified string into its corresponding PrisonerCaptureStyle enum 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 value NONE.
      Parameters:
      text - the string to be converted into a PrisonerCaptureStyle enum value. It can be the name of the enum constant or its ordinal value as a string.
      Returns:
      the corresponding PrisonerCaptureStyle enum constant if the string matches a name or ordinal value, otherwise NONE.
    • toString

      public String 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:
      toString in class Enum<PrisonerCaptureStyle>
      Returns:
      A String containing the localized label of the capture style.