org.jogre.comm
Class CommGameOver

java.lang.Object
  |
  +--org.jogre.comm.CommSimpleMessage
        |
        +--org.jogre.comm.CommTableMessage
              |
              +--org.jogre.comm.CommGameOver
All Implemented Interfaces:
ITransmittable

public class CommGameOver
extends CommTableMessage

Communication object to show that a game is over.

Version:
Alpha 0.1
Author:
Bob Marks

Field Summary
static int DRAW
          Player draws with another player.
static int RESIGN
          Player losses a game.
static int WIN
          Player wins a game.
 
Fields inherited from class org.jogre.comm.CommTableMessage
isPublic, NO_TABLE, tableNum
 
Fields inherited from class org.jogre.comm.CommSimpleMessage
status, username
 
Constructor Summary
protected CommGameOver()
          Empty constructor
  CommGameOver(String inString)
          Constructor which reads the game over object from a String.
  CommGameOver(String username, int status, int tableNum, int scoreIncrement)
          Constructor for a game over communication object.
 
Method Summary
 String flatten()
          Flatten communciation object.
 int getScoreIncrement()
          Return the score.
 
Methods inherited from class org.jogre.comm.CommTableMessage
getTableNum, isPublic
 
Methods inherited from class org.jogre.comm.CommSimpleMessage
getStatus, getUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIN

public static final int WIN
Player wins a game.

RESIGN

public static final int RESIGN
Player losses a game.

DRAW

public static final int DRAW
Player draws with another player.
Constructor Detail

CommGameOver

protected CommGameOver()
Empty constructor

CommGameOver

public CommGameOver(String username,
                    int status,
                    int tableNum,
                    int scoreIncrement)
Constructor for a game over communication object.
Parameters:
username - Username of the person.
status - Type of win e.g. WIN, DRAW or LOSS.
tableNum - Number of this table.
scoreIncrement - Increment to score if a rated game (this is negative if the player loses).

CommGameOver

public CommGameOver(String inString)
             throws TransmissionException
Constructor which reads the game over object from a String.
Parameters:
inString -  
Throws:
TransmissionException -  
Method Detail

getScoreIncrement

public int getScoreIncrement()
Return the score. If its a draw this will probobly be 0, a win a positive number and a negative number depending on the game.
Returns:
score increment.

flatten

public String flatten()
Flatten communciation object.
See Also:
ITransmittable.flatten()