Enum Class Piece
- All Implemented Interfaces:
Serializable,Comparable<Piece>,Constable
This class defines all existing Spectrangle pieces, there are triangle shape with three colors and one value.
- Author:
- Belegkarnil
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Method Summary
-
Enum Constant Details
-
PURPLE
-
GREEN
-
BLUE
-
YELLOW
-
RED
-
WHITE
-
PURPLE_GREEN
-
GREEN_RED
-
BLUE_RED
-
YELLOW_GREEN
-
RED_YELLOW
-
PURPLE_YELLOW
-
GREEN_BLUE
-
BLUE_PURPLE
-
YELLOW_BLUE
-
RED_PURPLE
-
PURPLE_RED
-
GREEN_YELLOW
-
BLUE_YELLOW
-
YELLOW_RED
-
RED_GREEN
-
PURPLE_BLUE
-
GREEN_PURPLE
-
BLUE_GREEN
-
YELLOW_PURPLE
-
RED_BLUE
-
GREEN_BLUE_PURPLE
-
GREEN_RED_BLUE
-
GREEN_PURPLE_YELLOW
-
GREEN_PURPLE_BLUE
-
GREEN_BLUE_YELLOW
-
GREEN_PURPLE_RED
-
BLUE_PURPLE_YELLOW
-
BLUE_PURPLE_RED
-
BLUE_RED_YELLOW
-
PURPLE_YELLOW_RED
-
-
Field Details
-
colorLeft
is the left triangle color (consider base at bottom) -
colorRight
is the right triangle color (consider base at bottom) -
colorBottom
is the bottom triangle color (consider base at bottom) -
value
public final int valueis the triangle value which is used for scoring purpose
-
-
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
-