Package megamek.common
Enum Class Facing
- All Implemented Interfaces:
Serializable,Comparable<Facing>,Constable
Enumeration of all 6 possible facings. It provides methods for translation from old integer constants. Utility
methods for turning left, right and getting opposite direction are also provided.
-
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 TypeMethodDescriptionintgetAngle()intMethod provided for backward compatibility with old integer constants.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.static FacingReturns the enum constant of this class with the specified name.static FacingvalueOfInt(int i) Method provided for backward compatibility with old integer constants.static Facing[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
N
-
NE
-
SE
-
S
-
SW
-
NW
-
NONE
-
-
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
-
valueOfInt
Method provided for backward compatibility with old integer constants.- Parameters:
i- Integer constant. must be non-negative
-
getIntValue
public int getIntValue()Method provided for backward compatibility with old integer constants. -
getAngle
public int getAngle()- Returns:
- Facing in degrees, e.g. N.getAngle() returns 0, NE.getAngle() returns 30 and S.getAngle() returns 180.
-
getOpposite
- Returns:
- Facing in the opposite direction e.g. N.getOpposite returns S
-
getNextClockwise
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the next facing in clockwise direction
-
getNextCounterClockwise
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the next facing in counterclockwise direction
-