|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Thread
Player
public abstract class Player
Superclass for a SimpleNIM game player
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected SimpleNIM |
game
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Player(SimpleNIM game)
Constructor |
|
| Method Summary | |
|---|---|
Player |
getNext()
Get the opponent |
abstract void |
makeMove()
Has the player make a move |
abstract void |
pickSticks(int sticks)
Pick up the specified number of sticks |
void |
run()
Runs the thread for the player |
void |
setNext(Player p)
Sets the opponent |
void |
setPickSticks(int noOfSticks)
Sets the number of sticks picked |
void |
turn()
Has this player take their turn |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected SimpleNIM game
| Constructor Detail |
|---|
public Player(SimpleNIM game)
game - SimpleNIM game| Method Detail |
|---|
public void setNext(Player p)
p - the opponentpublic Player getNext()
public void turn()
public abstract void makeMove()
public void run()
run in interface Runnablerun in class Threadpublic abstract void pickSticks(int sticks)
sticks - intpublic void setPickSticks(int noOfSticks)
noOfSticks - The number of sticks picked
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||