|
Othello 1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.drexel.cs.ai.othello.Othello
public class Othello
A class for playing the game Othello.
| Field Summary | |
|---|---|
static java.lang.String |
REV_DATE
The release date of this code. |
static java.lang.String |
VERSION
The release version of this code. |
| Constructor Summary | |
|---|---|
Othello(OthelloPlayer player1,
OthelloPlayer player2,
UserInterface ui)
Constructs a new othello game with the random number generator seeded randomly. |
|
Othello(OthelloPlayer player1,
OthelloPlayer player2,
UserInterface ui,
long seed)
Constructs a new othello game with a specific seed to the random number generator. |
|
| Method Summary | |
|---|---|
static OthelloPlayer |
instantiatePlayer(java.lang.String className,
java.lang.String playerName)
Attempts to instantiate a new OthelloPlayer with the
given playerName from the given class. |
void |
log(java.lang.Object message)
Logs a message to the user interface. |
void |
log(java.lang.String message)
Logs a message to the user interface. |
static void |
main(java.lang.String[] args)
Instantiates the players, loads the user interface, and plays the game until completion. |
OthelloPlayer |
play()
Causes this othello game instance to play until completion, returning the winner. |
static void |
printUsage()
Prints command line usage information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
public static final java.lang.String REV_DATE
| Constructor Detail |
|---|
public Othello(OthelloPlayer player1,
OthelloPlayer player2,
UserInterface ui,
long seed)
public Othello(OthelloPlayer player1,
OthelloPlayer player2,
UserInterface ui)
| Method Detail |
|---|
public static OthelloPlayer instantiatePlayer(java.lang.String className,
java.lang.String playerName)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.IllegalArgumentException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
java.lang.ClassNotFoundException,
java.lang.ClassCastException
OthelloPlayer with the
given playerName from the given class.
java.lang.ClassNotFoundException - if the class named className was not found in the current classpath.
java.lang.NoSuchMethodException - if the given class does not have a constructor that takes a single String argument.
java.lang.InstantiationException - if className represents an abstract class.
java.lang.IllegalAccessException - if the constructor of className enforces Java language access control and the underlying constructor is inaccessible.
java.lang.IllegalArgumentException - if an unwrapping conversion for primitive arguments of the class' constructor fails.
java.lang.reflect.InvocationTargetException - if the constructor of className throws an exception.
java.lang.ClassCastException - if className does not extend OthelloPlayer.public OthelloPlayer play()
null is returned if the
game resulted in a tie.
public void log(java.lang.Object message)
public void log(java.lang.String message)
public static void main(java.lang.String[] args)
public static void printUsage()
|
Othello 1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||