|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
vooga.engine.networking.server.Handler
vooga.engine.networking.server.ClientHandler
vooga.engine.networking.server.games.TicTacToeHandler
public class TicTacToeHandler
Extends ClientHandler to add TicTacToe specific logic to receiving and sending messages through the sockets. Every game will have a class like this that extends ClientHandler.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class vooga.engine.networking.server.ClientHandler |
---|
handlers, numberOfPlayers |
Fields inherited from class vooga.engine.networking.server.Handler |
---|
sessionID, socket |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TicTacToeHandler(VoogaDaemon daemon,
GameSocket socket,
int numberOfPlayers,
int gameNumber)
Calls ClientHandler's constructor. |
Method Summary | |
---|---|
void |
firstRun()
Right after the correct number of players is found, tell the first player that it is their turn and tell the other player that it is their opponent's turn. |
void |
run()
Calls super.run() first to wait for the two players and call the firstRun method. |
Methods inherited from class vooga.engine.networking.server.ClientHandler |
---|
broadcastToAll, broadcastToOthers, getFirstPlayer, getPlayers |
Methods inherited from class vooga.engine.networking.server.Handler |
---|
getSessionID, getSocket |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, 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 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TicTacToeHandler(VoogaDaemon daemon, GameSocket socket, int numberOfPlayers, int gameNumber)
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class ClientHandler
public void firstRun()
firstRun
in class ClientHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |