|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectheurgame.PlayerProxy
Field Summary | |
protected LogBox |
debugging
|
protected java.io.BufferedReader |
fromPlayer
fromPlayer The part we read from the player. |
protected PlayerToken |
token
Each Individual Player has posesson of a single token that identifies them to the system. |
protected java.io.PrintWriter |
toPlayer
toPlayer The part we write to the player. |
Constructor Summary | |
PlayerProxy()
|
Method Summary | |
abstract java.lang.String |
getMove(java.lang.String query)
Informs the player that it is their turn. |
PlayerToken |
getToken()
Allows other components to have a partial handle on the player state without giving them too much information. |
abstract void |
sendDisqualify(java.lang.String reason)
Informs the player that they have been disqualified from the game. |
abstract void |
sendFinalStatus(java.lang.String status)
Informs the player of its final status in the game. |
abstract void |
sendIncrementalStatus(java.lang.String status)
Sends the latest change in status |
abstract void |
sendInitialStatus(java.lang.String status)
Informs the player of the initial status of the game. |
abstract java.lang.String |
sendInvalidMove(java.lang.String information)
Uses the protocol to inform the player they have made an invalid move |
abstract void |
sendStatus(java.lang.String status)
Sends intermediate game status |
void |
setup(PlayerProxy parent,
java.lang.String origin,
java.net.Socket s)
This should be useed in liew of a constructor. |
abstract void |
setupLogging(LogBox debugger)
Taylors the debugging method to an implementation specific one |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LogBox debugging
protected PlayerToken token
protected java.io.BufferedReader fromPlayer
fromPlayer
The part we read from the player.
protected java.io.PrintWriter toPlayer
toPlayer
The part we write to the player.
Constructor Detail |
public PlayerProxy()
Method Detail |
public final void setup(PlayerProxy parent, java.lang.String origin, java.net.Socket s) throws java.io.IOException
parent
- The originating PlayerProxyorigin
- The source of the Proxy, should be a hostname and ports
- Actual socket connected to the player
java.io.IOException
- Will be thrown in case of socket problems.public PlayerToken getToken()
public abstract java.lang.String getMove(java.lang.String query)
query
- game specific information for the player
public abstract void sendDisqualify(java.lang.String reason)
reason
- why the person was disqualifiedpublic abstract void sendInitialStatus(java.lang.String status)
status
- specific to the individual game.public abstract void sendFinalStatus(java.lang.String status)
status
- specific to the inidividual gamepublic abstract void sendStatus(java.lang.String status)
status
- specific informationpublic abstract void sendIncrementalStatus(java.lang.String status)
status
- game specificpublic abstract java.lang.String sendInvalidMove(java.lang.String information)
information
- why the move was invalid
public abstract void setupLogging(LogBox debugger)
debugger
- A prepackaged system that allows easy logging
capability.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |