|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectGlomus.Client.Java.JavaClient
public class JavaClient
A demonstration client that plays a legal, but ignorant game. To extend, add intelligent behavior to the following methods as desired; additional state may be necessary as well.
Glomus.Client.Client,
Glomus.Client.ServerConnection| Constructor Summary | |
|---|---|
JavaClient()
|
|
| 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)
A request to determine which pieces of information in the case folder this player knows |
static void |
main(java.lang.String[] args)
Main connects to the server, initializes the game, and has the server play with an instance of this class for the 'brains' |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaClient()
| Method Detail |
|---|
public 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)
init in interface Clientidentity - Our namestartRoom - Our starting locationsuspects - The set of all suspect namesweapons - The set of all weapon namesrooms - The map of all rooms to a list of adjacent roomscards - The set of all cards this player hasplayers - A list of suspects who are active in the game, in
order of play (if that's important)
public void suggestion(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suggestion in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationpublic void makeSuggestion(ServerConnection server)
makeSuggestion in interface Clientserver - The Glomus Server to reply topublic void makeAccusation(ServerConnection server)
makeAccusation in interface Clientserver - The Glomus Server to reply to
public void refute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player,
ServerConnection server)
refute in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationserver - The Glomus Server to reply to
public void refuted(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
refuted in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who refuted the suggestion
public void cantRefute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
cantRefute in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - is the player who could not refute the suggestion
public void accuse(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
accuse in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who failed their accusation
public void shows(java.lang.String player,
java.lang.String card)
shows in interface Clientplayer - The player who is refuting our suggestioncard - A suspect, weapon, or room that they show to us,
refuting our claimpublic void knows(ServerConnection server)
knows in interface Clientserver - The Glomus Server to reply to
public void endKnowledge(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
endKnowledge in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who knows the given info
public void answer(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
answer in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who won the gamepublic void message(java.lang.String message)
message in interface Clientmessage - The message to pass onto the user
public static void main(java.lang.String[] args)
throws java.io.IOException
args - Parameters for setting up the game
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||