|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectTTTccpListener
public class TTTccpListener
TTT project file that listens for CCP messages and reacts in an appropriate fashion
| Field Summary | |
|---|---|
private boolean |
done
status of the CCP Message Listener |
private TTTengine |
tttEngine
reference to the main engine class |
| Constructor Summary | |
|---|---|
TTTccpListener(TTTengine tttEngine)
Copy the engine reference and set status to false |
|
| Method Summary | |
|---|---|
private void |
commandKill()
Sends exit message and tells GUI to close everything |
private void |
endGame(java.lang.String from)
If currently playing a game, end it. |
private void |
getState()
If the state is there, return it and success. |
private void |
makeMove(java.lang.String player,
java.lang.String flags)
If playing a game, set appropriate letter on GUI and if using auto mode, tell the robix interface to draw the letter on the real board. |
void |
run()
Main execution loop starts when thread is started. |
private void |
setAutoModeReady(java.lang.String flags)
Marks Vision System and Robix Interface as ready when their modules are online |
private void |
setOpponent(java.lang.String name,
java.lang.String from)
New opponent can only be set while not playing a game. |
private void |
setOpponentAlert(java.lang.String from)
Marks LA Opponents as alert when correct message is received from their modules |
private void |
startNewAutoGame(java.lang.String from,
java.lang.String type,
java.lang.String flags)
If already playing a game, sends error message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private TTTengine tttEngine
private boolean done
| Constructor Detail |
|---|
public TTTccpListener(TTTengine tttEngine)
tttEngine - - reference to main engine class| Method Detail |
|---|
public void run()
run in interface java.lang.Runnable
private void makeMove(java.lang.String player,
java.lang.String flags)
throws javaClient.exceptions.MsgFieldLenException
player - - string that is either HUMAN or ROBOTflags - - string version of a number of a cell 1 - 9
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loopprivate void setOpponentAlert(java.lang.String from)
private void setAutoModeReady(java.lang.String flags)
private void commandKill()
throws javaClient.exceptions.MsgFieldLenException
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loop
private void startNewAutoGame(java.lang.String from,
java.lang.String type,
java.lang.String flags)
throws javaClient.exceptions.MsgFieldLenException
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loop
private void endGame(java.lang.String from)
throws javaClient.exceptions.MsgFieldLenException
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loop
private void setOpponent(java.lang.String name,
java.lang.String from)
throws javaClient.exceptions.MsgFieldLenException
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loop
private void getState()
throws javaClient.exceptions.MsgFieldLenException
javaClient.exceptions.MsgFieldLenException - - Dealth with by try/catch in main loop
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||