Enum Class Terrain
- All Implemented Interfaces:
Serializable
,Comparable<Terrain>
,Constable
An enum that represents the different terrains
that the battles can occur on.
- Version:
- 1.2 15.05.2022
- Author:
- Carl Gützkow
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the name from the enumstatic Terrain
getTerrain
(String readableName) Gets a Terrain enum from a string.static Terrain
Returns the enum constant of this class with the specified name.static Terrain[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PLAINS
-
FOREST
-
HILLS
-
-
Field Details
-
readableName
-
terrains
-
-
Constructor Details
-
Terrain
The enum constructor- Parameters:
readableName
- String - the enum in PascalCase
-
-
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
-
getReadableName
Gets the name from the enum- Returns:
- readableName - String - enum in PascalCase
-
getTerrain
Gets a Terrain enum from a string. If a terrain was not found, null is returned instead.- Parameters:
readableName
- String - the enum in PascalCase- Returns:
- UnitType - the enum respective to the readable name
-