edu.ou.pacman.util
Enum AI
java.lang.Object
java.lang.Enum<AI>
edu.ou.pacman.util.AI
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<AI>
public enum AI
- extends java.lang.Enum<AI>
Describes the intelligence types that are possible.
- Author:
- Derek Rushing
Method Summary |
static AI |
getAI(java.lang.String ai)
Parse a string and determine the AI that it is calling for. |
static AI |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static AI[] |
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 |
A_STAR
public static final AI A_STAR
GREEDY_BEST_FIRST
public static final AI GREEDY_BEST_FIRST
NONE
public static final AI NONE
PACMAN_FOLLOWER
public static final AI PACMAN_FOLLOWER
PELLET_FINDER
public static final AI PELLET_FINDER
PLAYER_CONTROLLED
public static final AI PLAYER_CONTROLLED
values
public static AI[] 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 (AI c : AI.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static AI 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
getAI
public static AI getAI(java.lang.String ai)
- Parse a string and determine the AI that it is calling for. Defaults to Greedy Best First if it
can't come to a decent conclusion.
- Parameters:
ai
- - The artificial intelligence as a string representation.
- Returns:
- The AI that correlates to the string.