Enum Class MovementDirection
- All Implemented Interfaces:
Serializable, Comparable<MovementDirection>, Constable
Represents all possible movement directions of a Structure.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<MovementDirection> Unmodifiable set of the four cardinal directions; north, east, south, and west. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<MovementDirection> getMovementDirection(String name) Gets theMovementDirectionfrom a name.static MovementDirectionGet theMovementDirectionthat's the exact opposite of the provided one.static intGets the index value of aMovementDirection.static booleanisCardinalDirection(@Nullable MovementDirection direction) Check if the providedMovementDirectionis a cardinal direction.static @Nullable MovementDirectionvalueOf(int dir) Gets theMovementDirectionfrom an index value.static MovementDirectionReturns the enum constant of this class with the specified name.static MovementDirection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
CLOCKWISE
-
COUNTERCLOCKWISE
-
UP
-
DOWN
-
NORTH
-
EAST
-
SOUTH
-
WEST
-
-
Field Details
-
CARDINAL_DIRECTIONS
Unmodifiable set of the four cardinal directions; north, east, south, and 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
Gets the index value of aMovementDirection.- Parameters:
dir- TheMovementDirection.- Returns:
- The index value of a
MovementDirection.
-
valueOf
Gets theMovementDirectionfrom an index value.- Parameters:
dir- TheMovementDirection.- Returns:
- The
MovementDirectionassociated with this index value.
-
getMovementDirection
Gets theMovementDirectionfrom a name.- Parameters:
name- The name of theMovementDirection.- Returns:
- The
MovementDirectionassociated with this name.
-
getOpposite
Get theMovementDirectionthat's the exact opposite of the provided one. For example, the opposite side ofUPisDOWN.- Parameters:
dir- The currentMovementDirection- Returns:
- The opposite direction of the current
MovementDirection.
-
isCardinalDirection
Check if the providedMovementDirectionis a cardinal direction.- Parameters:
direction- TheMovementDirectionto check.- Returns:
- True if the provided
MovementDirectionis a cardinal direction, false otherwise.
-
getLocalizationKey
-