Package megamek.common.enums
Enum Class VariableRangeTargetingMode
- All Implemented Interfaces:
Serializable,Comparable<VariableRangeTargetingMode>,Constable
Represents the targeting mode for the Variable Range Targeting quirk.
Per BMM pg. 86: - Player selects Long or Short mode during End Phase for the NEXT turn - LONG mode: -1 TN at long range, +1 TN at short range - SHORT mode: -1 TN at short range, +1 TN at long range - Medium range is unaffected by either mode
-
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 VariableRangeTargetingModeReturns the default targeting mode (LONG).intReturns the long range modifier for this mode.intReturns the short range modifier for this mode.booleanisLong()booleanisShort()static VariableRangeTargetingModeReturns the enum constant of this class with the specified name.static VariableRangeTargetingMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LONG
Long range preference: -1 to long range attacks, +1 to short range attacks -
SHORT
Short range preference: -1 to short range attacks, +1 to long range attacks
-
-
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
-
isLong
public boolean isLong() -
isShort
public boolean isShort() -
defaultMode
Returns the default targeting mode (LONG).- Returns:
- the default VariableRangeTargetingMode
-
getShortRangeModifier
public int getShortRangeModifier()Returns the short range modifier for this mode.- Returns:
- -1 for SHORT mode (bonus), +1 for LONG mode (penalty)
-
getLongRangeModifier
public int getLongRangeModifier()Returns the long range modifier for this mode.- Returns:
- -1 for LONG mode (bonus), +1 for SHORT mode (penalty)
-