Package megamek.common.enums
Enum Class ForcedWithdrawalOrder
- All Implemented Interfaces:
Serializable,Comparable<ForcedWithdrawalOrder>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNo order: the unit withdraws once crippled, if its bot follows Forced Withdrawal.The unit never withdraws, even when crippled: a fight to the death.The unit withdraws now, whatever its condition, even if its bot does not follow Forced Withdrawal. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisWithdrawing(boolean botFollowsForcedWithdrawal, boolean isCrippled) Returns whether a unit under this order withdraws under Forced Withdrawal.static ForcedWithdrawalOrderReturns the enum constant of this class with the specified name.static ForcedWithdrawalOrder[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BOT_RULES
No order: the unit withdraws once crippled, if its bot follows Forced Withdrawal. -
WITHDRAW
The unit withdraws now, whatever its condition, even if its bot does not follow Forced Withdrawal. -
FIGHT_TO_THE_DEATH
The unit never withdraws, even when crippled: a fight to the death.
-
-
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
-
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-trueif the unit's bot follows the Forced Withdrawal rulesisCrippled-trueif the unit is crippled, counting crew damage- Returns:
trueif the unit withdraws
-