Package megamek.common
Enum Class OffBoardDirection
- All Implemented Interfaces:
Serializable,Comparable<OffBoardDirection>,Constable
This interface represents Off-Board Directions
-
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 OffBoardDirectionfromBoardStart(int boardStart) Creates an OffBoardDirection from a Board.START_X constant.static OffBoardDirectiongetDirection(int value) static OffBoardDirectiongetOpposite(OffBoardDirection value) Gets the opposite direction of the given direction.intgetValue()intDeprecated, for removal: This API element is subject to removal in a future version.static OffBoardDirectiontranslateBoardStart(int value) Translate a "START_X" constant from Board.java into one of these values if possible.static OffBoardDirectiontranslateStartPosition(int startPos) Returns the OffBoardDirection associated with given the on-board deployment position as defined in IStartingPositions.static OffBoardDirectionReturns the enum constant of this class with the specified name.static OffBoardDirection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
NORTH
-
SOUTH
-
EAST
-
WEST
-
-
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
-
getValue
public int getValue() -
getDirection
-
translateBoardStart
Translate a "START_X" constant from Board.java into one of these values if possible. -
getOpposite
Gets the opposite direction of the given direction. -
translateBoardStart
Deprecated, for removal: This API element is subject to removal in a future version.Converts this OffBoardDirection to a Board.START_X constant.- Returns:
- The corresponding Board.START_X value, or Board.START_ANY for NONE
-
fromBoardStart
Creates an OffBoardDirection from a Board.START_X constant. This is the inverse of translateBoardStart().- Parameters:
boardStart- A Board.START_X constant- Returns:
- The corresponding OffBoardDirection, or NONE if not recognized
-
translateStartPosition
Returns the OffBoardDirection associated with given the on-board deployment position as defined in IStartingPositions.
-