Glomus.Client.Java
Interface Client

All Known Implementing Classes:
GUIclient, JavaClient

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.

See Also:
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

init

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

Parameters:
identity - Our name
startRoom - Our starting location
suspects - Set of all suspect names
weapons - Set of all weapon names
rooms - Map of all rooms to a list of adjacent rooms
cards - Set of all cards this player has
players - List of suspects who are active in the game, in the order they play (if that's important)

suggestion

void suggestion(java.lang.String suspect,
                java.lang.String weapon,
                java.lang.String room,
                java.lang.String player)
A suggestion overheard by all players

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player making the accusation

makeSuggestion

void makeSuggestion(ServerConnection server)
A request for this player to make a suggestion

Parameters:
server - The Glomus Server to reply to

makeAccusation

void makeAccusation(ServerConnection server)
A request for this player to make an accusation, if we wish

Parameters:
server - The Glomus Server to reply to

refute

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

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player making the accusation
server - The Glomus Server to reply to

refuted

void refuted(java.lang.String suspect,
             java.lang.String weapon,
             java.lang.String room,
             java.lang.String player)
A refuted suggestion overheard

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player who refuted the suggestion

cantRefute

void cantRefute(java.lang.String suspect,
                java.lang.String weapon,
                java.lang.String room,
                java.lang.String player)
A failed refutation overheard

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player who could not refute the suggestion

shows

void shows(java.lang.String player,
           java.lang.String card)
A refutation of our suggestion from another player

Parameters:
player - The player who is refuting our suggestion
card - A suspect, weapon, or room that they show to us, refuting our suggestion

accuse

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)

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player who failed their accusation

knows

void knows(ServerConnection server)
Asks what information this player knows for certain (from the case folder)

Parameters:
server - The Glomus Server to reply to

endKnowledge

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

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player who knows the given info

answer

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

Parameters:
suspect - Who did it
weapon - How they did it
room - Where they did it
player - The player who won the game

message

void message(java.lang.String message)
Notifies the client of some user-specific information

Parameters:
message - Message to pass on to the client