|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectheurgame.HuClient
Field Summary | |
protected LogBox |
debugging
|
protected java.io.BufferedReader |
fromServer
fromPlayer The part we read from the player. |
protected HuReceptor |
guiReceptor
guiReceptor is the component that the user interacts with to play the game. |
protected java.lang.String |
move
move is a protocol specific string that corresponds to a players move. |
protected java.io.PrintWriter |
toServer
toPlayer The part we write to the player. |
Constructor Summary | |
HuClient()
|
Method Summary | |
void |
connect(java.net.Socket s,
java.lang.String name)
This method should be called before loading the HeuClient into a thread. |
void |
fromOutside(java.lang.String ans)
Another portion of the input contract Notifies the component of some new external data |
abstract void |
handleDisqualification(java.lang.String reason)
Informs us that we have been rejected from the game |
abstract void |
handleFinalStatus(java.lang.String status)
Ususally the final outcome of the game. |
abstract void |
handleIncrementalStatus(java.lang.String status)
Gets the latest change in status |
abstract void |
handleInitialStatus(java.lang.String status)
Initial Status usually does not involve the actions of other players. |
abstract java.lang.String |
handleInvalidMove(java.lang.String reason)
Now knowing the reason for an invalid move, the player should respond with a hopefully valid move. |
abstract java.lang.String |
handleMove(java.lang.String query)
Invoked when it is our turn to move. |
abstract void |
handleStatus(java.lang.String status)
Usuallly the state of other players during the game. |
void |
setReceptor(HuReceptor h)
The Initial portion of the outside input contract that allows the HuClient access to user input. |
abstract java.lang.String |
waitForMessage()
This should be called as the thread polls |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
run |
Field Detail |
protected LogBox debugging
protected java.io.BufferedReader fromServer
fromPlayer
The part we read from the player.
protected java.io.PrintWriter toServer
toPlayer
The part we write to the player.
protected volatile java.lang.String move
move
is a protocol specific string that corresponds to a players move.
protected HuReceptor guiReceptor
guiReceptor
is the component that the user interacts with to play the game.
Constructor Detail |
public HuClient()
Method Detail |
public void setReceptor(HuReceptor h)
h
- some component that will notify us when
we desire information.public void fromOutside(java.lang.String ans)
ans
- Specific to implementation.public final void connect(java.net.Socket s, java.lang.String name) throws java.io.IOException
s
- An open bound constructed sockectname
- Represents this player
java.io.IOException
public abstract java.lang.String waitForMessage()
public abstract java.lang.String handleMove(java.lang.String query)
query
- The state of the game as defined by the server.
public abstract java.lang.String handleInvalidMove(java.lang.String reason)
reason
- why the move was invalid
public abstract void handleInitialStatus(java.lang.String status)
status
- specific to gamepublic abstract void handleStatus(java.lang.String status)
status
- game specificpublic abstract void handleIncrementalStatus(java.lang.String status)
status
- game specificpublic abstract void handleFinalStatus(java.lang.String status)
status
- exepected to be something of the lines of WIN, LOSE, or TIEpublic abstract void handleDisqualification(java.lang.String reason)
reason
- for the rejection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |