|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--thegame.client.GameClient.GameScreen.Monitor
Is used for counting the elapsed turn time of the active player; also for checking whether the local player has made a move.
Field Summary | |
protected java.text.SimpleDateFormat |
formatter
Is used to convert a time in milliseconds into a HH:MM:SS format. |
protected boolean |
isFirstChange
Is true if the player whose time the Monitor is counting has been changed and the Monitor is not aware of it yet; is false otherwise. |
protected boolean |
isRunning
Is true if the Monitor is running; is false otherwise. |
protected boolean |
isSetRunning
Is true if the Monitor has been set running but the main cycle of the run() method has not been entered yet; is false otherwise. |
protected boolean |
isStarted
Is true if the Monitor has already been started; is false otherwise. |
protected boolean |
isTickingLocalPlayer
Is true if the Monitor is counting the time of the local player; is false if the Monitor is counting the time of the remote player. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
GameClient.GameScreen.Monitor()
Constructs a Monitor. |
Method Summary | |
void |
run()
Counts the time of the player whose turn it is. |
void |
setRunning(boolean running)
Either starts or stops the Monitor thread. |
void |
setTickingLocalPlayer(boolean isTickingLocalPlayer)
Is used to change the player whose time is being counted. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 java.text.SimpleDateFormat formatter
protected boolean isFirstChange
protected boolean isRunning
protected boolean isSetRunning
protected boolean isStarted
protected boolean isTickingLocalPlayer
Constructor Detail |
public GameClient.GameScreen.Monitor()
Method Detail |
public void run()
run
in class java.lang.Thread
public void setRunning(boolean running)
running
- true if the thread will be set running, false if the thread will be stopped.public void setTickingLocalPlayer(boolean isTickingLocalPlayer)
isTickingLocalPlayer
- true if the Monitor will start counting the time of the local player; false if the Monitor will start counting the time of the remote player
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |