edu.ou.pacman.character
Enum CharacterType
java.lang.Object
java.lang.Enum<CharacterType>
edu.ou.pacman.character.CharacterType
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<CharacterType>
public enum CharacterType
- extends java.lang.Enum<CharacterType>
Enumeration for the characters possible for the game.
- Author:
- Derek Rushing
Method Summary |
static int |
colorValue(CharacterType color)
The value for the color in the game board space. |
java.awt.image.BufferedImage |
image()
Return the image for this bonus type. |
static CharacterType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static CharacterType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
Methods inherited from class java.lang.Enum |
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Pacman
public static final CharacterType Pacman
Blue
public static final CharacterType Blue
Color
public static final CharacterType Color
Orange
public static final CharacterType Orange
Pink
public static final CharacterType Pink
Red
public static final CharacterType Red
PACMAN
public static final int PACMAN
- See Also:
- Constant Field Values
BLUE
public static final int BLUE
- See Also:
- Constant Field Values
ORANGE
public static final int ORANGE
- See Also:
- Constant Field Values
PINK
public static final int PINK
- See Also:
- Constant Field Values
RED
public static final int RED
- See Also:
- Constant Field Values
values
public static CharacterType[] 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 (CharacterType c : CharacterType.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static CharacterType 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
colorValue
public static int colorValue(CharacterType color)
- The value for the color in the game board space.
- Parameters:
color
- - The character type to get the value for
- Returns:
- The int value for the character type.
image
public java.awt.image.BufferedImage image()
- Return the image for this bonus type.