edu.ou.pacman.util
Enum BonusType

java.lang.Object
  extended by java.lang.Enum<BonusType>
      extended by edu.ou.pacman.util.BonusType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BonusType>

public enum BonusType
extends java.lang.Enum<BonusType>

List of possible bonus types for the pac-man game board.

Author:
Derek Rushing

Enum Constant Summary
BANANAS
           
CHERRIES
           
GRAPES
           
NO_BONUS
           
ORANGES
           
STRAWBERRIES
           
 
Method Summary
static java.awt.image.BufferedImage bonusImage(BonusType type)
          Return an image for the specified bonus type.
 java.awt.image.BufferedImage image()
          Return the image for this bonus type.
static BonusType random()
          Return a random BonusType.
static BonusType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BonusType[] 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
 

Enum Constant Detail

BANANAS

public static final BonusType BANANAS

CHERRIES

public static final BonusType CHERRIES

GRAPES

public static final BonusType GRAPES

NO_BONUS

public static final BonusType NO_BONUS

ORANGES

public static final BonusType ORANGES

STRAWBERRIES

public static final BonusType STRAWBERRIES
Method Detail

values

public static BonusType[] 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 (BonusType c : BonusType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BonusType 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

bonusImage

public static java.awt.image.BufferedImage bonusImage(BonusType type)
Return an image for the specified bonus type.

Parameters:
type - - The type to use
Returns:
The image representing the bonus type.

image

public java.awt.image.BufferedImage image()
Return the image for this bonus type.


random

public static BonusType random()
Return a random BonusType. Can't be NO_BONUS