images
Enum PieceImage
java.lang.Object
java.lang.Enum<PieceImage>
images.PieceImage
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<PieceImage>
public enum PieceImage
- extends java.lang.Enum<PieceImage>
This class contains all the image files associated with the pieces. It provides a image retriever
method that gets the image from the Piece Constants specified in the Piece class.
- Author:
- Jesse Wang
Field Summary |
private java.awt.Image |
IMAGE
The Image that is encapsulated in the PieceImage object. |
Method Summary |
static java.awt.Image |
getPieceGivenID(int PieceType,
int Colour)
Gets the image encapsulated an an enumeration object with the specified Piece type
and colour according to the constants in the "Piece" calss. |
static PieceImage |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static PieceImage[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
Methods inherited from class java.lang.Enum |
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
WHITE_PAWN
public static final PieceImage WHITE_PAWN
BLACK_PAWN
public static final PieceImage BLACK_PAWN
WHITE_ROOK
public static final PieceImage WHITE_ROOK
BLACK_ROOK
public static final PieceImage BLACK_ROOK
WHITE_KNIGHT
public static final PieceImage WHITE_KNIGHT
BLACK_KNIGHT
public static final PieceImage BLACK_KNIGHT
WHITE_BISHOP
public static final PieceImage WHITE_BISHOP
BLACK_BISHOP
public static final PieceImage BLACK_BISHOP
WHITE_QUEEN
public static final PieceImage WHITE_QUEEN
BLACK_QUEEN
public static final PieceImage BLACK_QUEEN
WHITE_KING
public static final PieceImage WHITE_KING
BLACK_KING
public static final PieceImage BLACK_KING
IMAGE
private java.awt.Image IMAGE
- The Image that is encapsulated in the PieceImage object.
values
public static PieceImage[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (PieceImage c : PieceImage.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static PieceImage valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is null
getPieceGivenID
public static java.awt.Image getPieceGivenID(int PieceType,
int Colour)
- Gets the image encapsulated an an enumeration object with the specified Piece type
and colour according to the constants in the "Piece" calss.
- Parameters:
PieceType
- The type of the Piece.Colour
- The colour of the Piece.
- Returns:
- The image encapsulated in the specified enumeration type. Null if it does not
exist.