|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Client
The common messages that all Glomus Clients implement. All user and AI players must implement the client interface. The ServerConnection class takes care of all protocol and communication with the actual Server, the client interface's implementing classes should call the corresponding methods of the ServerConnection to send their decisions to the game.
Glomus.Client.ServerConnection| Method Summary | |
|---|---|
void |
accuse(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A failed accusation overheard (successful ones end the game, and thus do not need to be reported) |
void |
answer(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
Tells the client who won and what the answer was |
void |
cantRefute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A failed refutation overheard |
void |
endKnowledge(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
Informs the player of what another player in the game knows for certain |
void |
init(java.lang.String identity,
java.lang.String startRoom,
java.util.HashSet<java.lang.String> suspects,
java.util.HashSet<java.lang.String> weapons,
java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> rooms,
java.util.HashSet<java.lang.String> cards,
java.util.ArrayList<java.lang.String> players)
Initialize the player's knowledgebase with the suspects, weapons, rooms (and their connectivity), and the cards that this player has |
void |
knows(ServerConnection server)
Asks what information this player knows for certain (from the case folder) |
void |
makeAccusation(ServerConnection server)
A request for this player to make an accusation, if we wish |
void |
makeSuggestion(ServerConnection server)
A request for this player to make a suggestion |
void |
message(java.lang.String message)
Notifies the client of some user-specific information |
void |
refute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player,
ServerConnection server)
A request for this player to refute the claim, if possible |
void |
refuted(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A refuted suggestion overheard |
void |
shows(java.lang.String player,
java.lang.String card)
A refutation of our suggestion from another player |
void |
suggestion(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A suggestion overheard by all players |
| Method Detail |
|---|
void init(java.lang.String identity,
java.lang.String startRoom,
java.util.HashSet<java.lang.String> suspects,
java.util.HashSet<java.lang.String> weapons,
java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> rooms,
java.util.HashSet<java.lang.String> cards,
java.util.ArrayList<java.lang.String> players)
identity - Our namestartRoom - Our starting locationsuspects - Set of all suspect namesweapons - Set of all weapon namesrooms - Map of all rooms to a list of adjacent roomscards - Set of all cards this player hasplayers - List of suspects who are active in the game, in
the order they play (if that's important)
void suggestion(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationvoid makeSuggestion(ServerConnection server)
server - The Glomus Server to reply tovoid makeAccusation(ServerConnection server)
server - The Glomus Server to reply to
void refute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player,
ServerConnection server)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationserver - The Glomus Server to reply to
void refuted(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who refuted the suggestion
void cantRefute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who could not refute the suggestion
void shows(java.lang.String player,
java.lang.String card)
player - The player who is refuting our suggestioncard - A suspect, weapon, or room that they show to us,
refuting our suggestion
void accuse(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who failed their accusationvoid knows(ServerConnection server)
server - The Glomus Server to reply to
void endKnowledge(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who knows the given info
void answer(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who won the gamevoid message(java.lang.String message)
message - Message to pass on to the client
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||