Enum Class PlayerSpeed
- All Implemented Interfaces:
Serializable
,Comparable<PlayerSpeed>
,Constable
Useful enumeration of the different possible speed level for a player.
- Since:
- 04/10/2022
-
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 Optional<PlayerSpeed>
fromFlySpeed
(float flySpeed) Get a speed level from the player's fly speed level.static Optional<PlayerSpeed>
fromWalkSpeed
(float walkSpeed) Get a speed level from the player's walk speed level.float
Get the fly speed value.float
Get the walk speed value.static PlayerSpeed
Returns the enum constant of this class with the specified name.static PlayerSpeed[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LEVEL_0
-
LEVEL_1
-
LEVEL_2
-
LEVEL_3
-
LEVEL_4
-
LEVEL_5
-
LEVEL_6
-
LEVEL_7
-
LEVEL_8
-
LEVEL_9
-
LEVEL_10
-
-
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
-
fromWalkSpeed
Get a speed level from the player's walk speed level.- Parameters:
walkSpeed
- Speed level.- Returns:
- Optional speed level.
-
fromFlySpeed
Get a speed level from the player's fly speed level.- Parameters:
flySpeed
- Speed level.- Returns:
- Optional speed level.
-
getWalkLevel
public float getWalkLevel()Get the walk speed value.- Returns:
- Speed level.
-
getFlyLevel
public float getFlyLevel()Get the fly speed value.- Returns:
- Speed level.
-