|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectGlomus.Server.Player
Glomus.Server.RemotePlayer
public class RemotePlayer
The Player Class is used within the Server to keep track of remote players. The Player class has cards, a location, and a character that it is playing as. The Game class uses the Player to determine if an illegal move has been made, and to communicate with the actual remote Player
Protocol| Constructor Summary | |
|---|---|
RemotePlayer(java.net.Socket link)
Creates the server-side representation of an remote player. |
|
| Method Summary | |
|---|---|
java.lang.String |
accuse()
Asks the Player to communicate with its remote counterpart and make an accusation if they wish |
void |
deletePlayer()
Closes all I/O streams and sockets for this player. |
void |
forward(java.lang.String message)
Forwards the broadcast message to its remote counterpart |
java.lang.String |
getAnswer()
Asks the player to tell us all the pieces of the answer that it knows for sure |
java.lang.String |
refute(java.lang.String claim)
Asks the Player to communicate with its remote counterpart and make a refutation of the last suggestion (if it can) |
java.lang.String |
suggest()
Asks the Player to communicate with its remote counterpart and make a suggestion |
| Methods inherited from class Glomus.Server.Player |
|---|
forceMove, getCards, getInit, getLocation, getName, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemotePlayer(java.net.Socket link)
throws java.io.IOException
The - Socket on which the real remote player is communicating
java.io.IOException - If the I/O streams from the socket cannot be initialized| Method Detail |
|---|
public java.lang.String suggest()
throws IllegalTurnException,
TimeoutException,
NetworkFailureException,
java.lang.IllegalArgumentException
suggest in class PlayerIllegalTurnException - if player does not move to proper
room
java.lang.IllegalArgumentException - when player's message includes
illegal values
TimeoutException
NetworkFailureException
public java.lang.String refute(java.lang.String claim)
throws IllegalTurnException,
TimeoutException,
NetworkFailureException
refute in class PlayerThe - claim to refute, in the form "[suspect] [weapon] [room] [player]"
IllegalTurnException - when the remote player either didn't
refute when it could have, or refuted with a card it does not have
TimeoutException
NetworkFailureException
public java.lang.String accuse()
throws IllegalTurnException,
TimeoutException,
NetworkFailureException,
java.lang.IllegalArgumentException
accuse in class Playerjava.lang.IllegalArgumentException - when player's message includes
illegal values
IllegalTurnException
TimeoutException
NetworkFailureException
public java.lang.String getAnswer()
throws IllegalTurnException,
TimeoutException,
NetworkFailureException
getAnswer in class PlayerIllegalTurnException
TimeoutException
NetworkFailureExceptionpublic void forward(java.lang.String message)
forward in class PlayerThe - message to forward to the remote playerpublic void deletePlayer()
deletePlayer in class Player
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||