Package be.belegkarnil.game.board.tak
Enum Class Piece
- All Implemented Interfaces:
Serializable,Comparable<Piece>,Constable
TODO comments
- 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 ConstantDescriptionThis piece is a capstone associated to the black player (seeConstants)This piece is a capstone associated to the white player (seeConstants)This piece is a dolmen associated to the black player (seeConstants)This piece is a dolmen associated to the white player (seeConstants)This piece is a menhir associated to the black player (seeConstants)This piece is a menhir associated to the white player (seeConstants) -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanisBlack()booleanKnow if the current piece is a capstonebooleanisDolmen()Know if the current piece is a dolmenbooleanisMenhir()Know if the current piece is a menhirbooleanisWhite()static PieceReturns the enum constant of this class with the specified name.static Piece[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DOLMEN_BLACK
This piece is a dolmen associated to the black player (seeConstants) -
DOLMEN_WHITE
This piece is a dolmen associated to the white player (seeConstants) -
MENHIR_BLACK
This piece is a menhir associated to the black player (seeConstants) -
MENHIR_WHITE
This piece is a menhir associated to the white player (seeConstants) -
CAPSTONE_BLACK
This piece is a capstone associated to the black player (seeConstants) -
CAPSTONE_WHITE
This piece is a capstone associated to the white player (seeConstants)
-
-
Field Details
-
color
The color of the piece which is either black or white (seeConstants)
-
-
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
-
isWhite
public boolean isWhite()- Returns:
- true iff the piece is associated to the white player.
-
isBlack
public boolean isBlack()- Returns:
- true iff the piece is associated to the black player.
-
isMenhir
public boolean isMenhir()Know if the current piece is a menhir- Returns:
- true iff the piece is a menhir
-
isDolmen
public boolean isDolmen()Know if the current piece is a dolmen- Returns:
- true iff the piece is a dolmen
-
isCapstone
public boolean isCapstone()Know if the current piece is a capstone- Returns:
- true iff the piece is a capstone
-