client.framework.network.parser
Class Action

java.lang.Object
  extended by client.framework.network.parser.Action
Direct Known Subclasses:
BBAction

public class Action
extends java.lang.Object

A class that represents the framework's default actions. Each action consist of a three-letter string representation. These actions correspond to the Action enum in the server framework.

Author:
Martin Jarrett, Eivind Sorteberg

Field Summary
static Action ALIVE_REQUEST
           
static Action DISCONNECT
           
static Action GAME_OVER
           
protected  java.lang.String name
           
static Action PLAYER
           
static Action POSITION
           
static Action READY
           
static Action SCORE
           
static Action SESSION_LIST
           
static Action SESSION_SELECTED
           
static Action SETTING_CHANGED
           
static Action SETTINGS_LIST
           
static Action START
           
static Action TEAM
           
 
Constructor Summary
protected Action(java.lang.String name)
          Constructor.
 
Method Summary
 boolean equals(java.lang.String action)
          Checks whether an action string is equal to this action's name.
 java.lang.String getName()
          Returns the action's name.
 java.lang.String toString()
          Returns the action's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAYER

public static final Action PLAYER

ALIVE_REQUEST

public static final Action ALIVE_REQUEST

SESSION_LIST

public static final Action SESSION_LIST

SESSION_SELECTED

public static final Action SESSION_SELECTED

SETTINGS_LIST

public static final Action SETTINGS_LIST

SETTING_CHANGED

public static final Action SETTING_CHANGED

READY

public static final Action READY

START

public static final Action START

POSITION

public static final Action POSITION

SCORE

public static final Action SCORE

DISCONNECT

public static final Action DISCONNECT

GAME_OVER

public static final Action GAME_OVER

TEAM

public static final Action TEAM

name

protected java.lang.String name
Constructor Detail

Action

protected Action(java.lang.String name)
Constructor. Should only be used locally and by extensions of this class.

Parameters:
name - The name of the action.
Method Detail

toString

public java.lang.String toString()
Returns the action's name.

Overrides:
toString in class java.lang.Object
Returns:
The action's name.

getName

public java.lang.String getName()
Returns the action's name.

Returns:
The action's name.

equals

public boolean equals(java.lang.String action)
Checks whether an action string is equal to this action's name. Used to recognize actions sent from the server to the client.

Parameters:
action - The string to compare to the action.
Returns:
True if the string corresponds to the action, false if not.