Glomus.Client.Java
Enum Protocol.Message

java.lang.Object
  extended by java.lang.Enum<Protocol.Message>
      extended by Glomus.Client.Java.Protocol.Message
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Protocol.Message>
Enclosing class:
Protocol

public static enum Protocol.Message
extends java.lang.Enum<Protocol.Message>

Enumeration of message types. Maps name to message string and the number of arguments this message expects. Note that "numArgs" returns the number of arguments + 1 for the message name itself.


Enum Constant Summary
ACCUSE
          Message from client with a game-ending accusation
ANSWER
          Message to client giving away the answer after the game is finished
CANT_REFUTE
          Message to clients broadcasting that a player could not refute a suggestion
CLAIM
          Message to clients broadcasting a suggestion
CREATE
          Message from client asking for a new game to be created
ERROR
          Message to client indicating error occurred
GIVE_ANSWER
          Message to client asking which pieces of the answer they know
INIT
          Message to client with game parameters (variable number of parameters)
JOIN
          Message from client asking to join existing game
KNOW
          Message from client telling server which pieces of the answer are known, and to clients from the server as a broadcast of that same information
MAKE_ACCUSATION
          Message to client requesting accusation
MAKE_CLAIM
          Message to client asking for their next suggestion
MESSAGE
          Message to client with user-specific information to be logged/displayed
REFUTE
          Message to client asking them to refute a suggestion
REFUTED
          Message to clients broadcasting that a player refuted a suggestion
SHOW
          Message from client refuting a suggestion
SHOWS
          Message to client telling who refuted their suggestion with what
 
Method Summary
 int numArgs()
           
static Protocol.Message valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Protocol.Message[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ERROR

public static final Protocol.Message ERROR
Message to client indicating error occurred


MESSAGE

public static final Protocol.Message MESSAGE
Message to client with user-specific information to be logged/displayed


ACCUSE

public static final Protocol.Message ACCUSE
Message from client with a game-ending accusation


MAKE_ACCUSATION

public static final Protocol.Message MAKE_ACCUSATION
Message to client requesting accusation


CLAIM

public static final Protocol.Message CLAIM
Message to clients broadcasting a suggestion


MAKE_CLAIM

public static final Protocol.Message MAKE_CLAIM
Message to client asking for their next suggestion


CANT_REFUTE

public static final Protocol.Message CANT_REFUTE
Message to clients broadcasting that a player could not refute a suggestion


REFUTED

public static final Protocol.Message REFUTED
Message to clients broadcasting that a player refuted a suggestion


REFUTE

public static final Protocol.Message REFUTE
Message to client asking them to refute a suggestion


SHOW

public static final Protocol.Message SHOW
Message from client refuting a suggestion


SHOWS

public static final Protocol.Message SHOWS
Message to client telling who refuted their suggestion with what


CREATE

public static final Protocol.Message CREATE
Message from client asking for a new game to be created


JOIN

public static final Protocol.Message JOIN
Message from client asking to join existing game


INIT

public static final Protocol.Message INIT
Message to client with game parameters (variable number of parameters)


GIVE_ANSWER

public static final Protocol.Message GIVE_ANSWER
Message to client asking which pieces of the answer they know


KNOW

public static final Protocol.Message KNOW
Message from client telling server which pieces of the answer are known, and to clients from the server as a broadcast of that same information


ANSWER

public static final Protocol.Message ANSWER
Message to client giving away the answer after the game is finished

Method Detail

values

public static final Protocol.Message[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Protocol.Message c : Protocol.Message.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Protocol.Message valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

numArgs

public int numArgs()
Returns:
max number of arguments this message expects