Enum Class ForcedWithdrawalOrder

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

public enum ForcedWithdrawalOrder extends Enum<ForcedWithdrawalOrder>
A gamemaster's standing order on whether a bot-controlled unit withdraws under Forced Withdrawal, set from the Edit Damage dialog. It lets a scenario pull an unhurt unit off the field, or keep a crippled one fighting, without changing the bot's own behavior settings.
  • Enum Constant Details

    • BOT_RULES

      public static final ForcedWithdrawalOrder BOT_RULES
      No order: the unit withdraws once crippled, if its bot follows Forced Withdrawal.
    • WITHDRAW

      public static final ForcedWithdrawalOrder WITHDRAW
      The unit withdraws now, whatever its condition, even if its bot does not follow Forced Withdrawal.
    • FIGHT_TO_THE_DEATH

      public static final ForcedWithdrawalOrder FIGHT_TO_THE_DEATH
      The unit never withdraws, even when crippled: a fight to the death.
  • Method Details

    • values

      public static ForcedWithdrawalOrder[] 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 ForcedWithdrawalOrder 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
    • isWithdrawing

      public boolean isWithdrawing(boolean botFollowsForcedWithdrawal, boolean isCrippled)
      Returns whether a unit under this order withdraws under Forced Withdrawal. This is the one place that decides it, so the bot's movement, firing and honor rules all agree.
      Parameters:
      botFollowsForcedWithdrawal - true if the unit's bot follows the Forced Withdrawal rules
      isCrippled - true if the unit is crippled, counting crew damage
      Returns:
      true if the unit withdraws