public enum Piece extends Enum<Piece>
Enum Constant and Description |
---|
B_BISHOP |
B_KING |
B_KNIGHT |
B_PAWN |
B_QUEEN |
B_ROOK |
W_BISHOP |
W_KING |
W_KNIGHT |
W_PAWN |
W_QUEEN |
W_ROOK |
Modifier and Type | Method and Description |
---|---|
static Piece |
getByFENNote(char fenNote)
Returns the piece whose FEN sign matches the parameter.
|
static Piece |
getByUnicode(char unicode)
Returns the piece whose Unicode code matches the parameter.
|
char |
getCode()
Returns the Unicode code of the given piece.
|
char |
getFENNote()
Returns the FEN sign of the given piece.
|
static Piece |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Piece[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Piece W_KING
public static final Piece W_QUEEN
public static final Piece W_ROOK
public static final Piece W_BISHOP
public static final Piece W_KNIGHT
public static final Piece W_PAWN
public static final Piece B_KING
public static final Piece B_QUEEN
public static final Piece B_ROOK
public static final Piece B_BISHOP
public static final Piece B_KNIGHT
public static final Piece B_PAWN
public static Piece[] values()
for (Piece c : Piece.values()) System.out.println(c);
public static Piece valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic char getFENNote()
public char getCode()
public static Piece getByUnicode(char unicode)
unicode
- The Unicode character code of the sought piece.public static Piece getByFENNote(char fenNote)
fenNote
- The FEN sign of the sought piece.Copyright © 2020. All rights reserved.