|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--nu.dll.fia.Client
This is the class that servers for all communication between the Fia game and a Fia server.
It takes care of connecting and reading data from the server, as well as issuing commands
given to it by doCommand(String). It starts one thread to provide non-blocking
I/O with the server.
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Client(java.lang.String nickName,
java.lang.String host,
int port,
javax.swing.JTextArea textArea,
FiaPanel panel)
|
|
| Method Summary | |
int |
dice(int max,
int multip)
Query the server to roll a dice and block until a response has been received. |
void |
didTurn(nu.dll.fia.Player p,
nu.dll.fia.Move m,
boolean wasImpossible)
Called by GameEngine when a user has done their move. |
void |
doCommand(java.lang.String s)
Performs a command issued by a user, such as JOIN or LIST. |
nu.dll.fia.RemoteMove |
doTurn(int playerIndex)
Waits for a turn by a remote player. |
boolean |
isActive()
|
void |
run()
The thread's "main" method, which only reads the object data from the server. |
long |
time()
|
| 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 |
| Constructor Detail |
public Client(java.lang.String nickName,
java.lang.String host,
int port,
javax.swing.JTextArea textArea,
FiaPanel panel)
| Method Detail |
public void run()
serverMessage(Message) method.run in class java.lang.Threadpublic long time()
public int dice(int max,
int multip)
public boolean isActive()
public nu.dll.fia.RemoteMove doTurn(int playerIndex)
doTurn in interface RemotePlayer
public void didTurn(nu.dll.fia.Player p,
nu.dll.fia.Move m,
boolean wasImpossible)
public void doCommand(java.lang.String s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||