Package megamek.client.bot.princess
Enum Class CardinalEdge
- All Implemented Interfaces:
Serializable,Comparable<CardinalEdge>,Constable
- Since:
- 8/17/13 10:37 PM
-
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 CardinalEdgegetCardinalEdge(int index) Given an index, attempt to return a cardinal edge.static CardinalEdgegetCardinalEdge(OffBoardDirection direction) Convert an OffBoardDirection to a cardinal edgeintgetIndex()static CardinalEdgegetOppositeEdge(CardinalEdge edge) Attempt to determine the opposite edge, given another cardinal edgestatic CardinalEdgeparseFromString(String source) Given a string, attempt to figure out if it corresponds to a cardinal edgetoString()static CardinalEdgeReturns the enum constant of this class with the specified name.static CardinalEdge[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
NEAREST
-
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
-
getIndex
public int getIndex() -
toString
- Overrides:
toStringin classEnum<CardinalEdge>
-
getCardinalEdge
Given an index, attempt to return a cardinal edge. -
parseFromString
Given a string, attempt to figure out if it corresponds to a cardinal edge -
getCardinalEdge
Convert an OffBoardDirection to a cardinal edge -
getOppositeEdge
Attempt to determine the opposite edge, given another cardinal edge
-