|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectGlomus.Server.Player
Glomus.Server.AIplayer
public class AIplayer
The Player Class is used within the Server to keep track of AI 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 AI Player
| Constructor Summary | |
|---|---|
AIplayer(java.net.Socket link)
Creates the server-side representation of an AI player. |
|
| Method Summary | |
|---|---|
java.lang.String |
accuse()
Asks the Player to communicate with its AI 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 AI 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 AI counterpart and make a refutation of the last suggestion (if it can) |
java.lang.String |
suggest()
Asks the Player to communicate with its AI 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 AIplayer(java.net.Socket link)
throws java.io.IOException
The - Socket on which the real AI 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
suggest in class PlayerIllegalTurnException - When the number of arguments recieved from the distant
AI player was either too few or too many, and when the suggestion's location is not
a room that can be moved to from the player's prior location
TimeoutException - If the AI player takes too long to decide what it wants to do
NetworkFailureException - If the AIplayer loses contact with the distant AI
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 number of arguments recieved from the distant
AI player was either too few or too many, and when the AI either didn't refute when
it could have, or if it refuted with a card it does not have
TimeoutException - If the AI player takes too long to decide what it wants to do
NetworkFailureException - If the AIplayer loses contact with the distant AI
public java.lang.String accuse()
throws IllegalTurnException,
TimeoutException,
NetworkFailureException
accuse in class PlayerIllegalTurnException - When the number of arguments recieved from the distant
AI player was either too few or too many
TimeoutException - If the AI player takes too long to decide what it wants to do
NetworkFailureException - If the AIplayer loses contact with the distant AI
public java.lang.String[] getAnswer()
throws IllegalTurnException,
TimeoutException,
NetworkFailureException
IllegalTurnException - When the number of arguments recieved from the distant
AI player was either too few or too many
TimeoutException - If the AI player takes too long to decide what it wants to do
NetworkFailureException - If the AIplayer loses contact with the distant AIpublic void forward(java.lang.String message)
forward in class PlayerThe - message to forward to the AI playerpublic void deletePlayer()
deletePlayer in class Player
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||