feud.testgame.model
Class HighscoreTable

java.lang.Object
  extended byfeud.testgame.model.HighscoreTable

public class HighscoreTable
extends java.lang.Object

Contains the data of the in game score table. This is created from the score data that the server transmit each time the score changes.


Constructor Summary
HighscoreTable()
           
 
Method Summary
 void addLine(PlayerInfo pi)
          Adds a complete line to the table, i.e. the player's name, the number of frags he/she has and the number of deaths.
 void addLineEntry(InfoLine il)
          Adds a new entry to the table.
 void addToContainer(InfoDataContainer dc)
          Adds the table's content to an existing container.
 void clear()
          Clears the table
 DataContainer getContainer()
          Creates a DataContainer from the table's content that can be transfered via the network.
 int getFrags(int i)
          Gets the number of frags in i-th line.
 int getKilled(int i)
          Gets the number of deaths in i-th line.
 int getLineCount()
          Returns the number of lines in the table.
 java.lang.String getPlayerName(int i)
          Gets the name of the player in i-th line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighscoreTable

public HighscoreTable()
Method Detail

clear

public void clear()
Clears the table


addLineEntry

public void addLineEntry(InfoLine il)
Adds a new entry to the table. This is not a complete line but one part of it.

Parameters:
il - the entry

addLine

public void addLine(PlayerInfo pi)
Adds a complete line to the table, i.e. the player's name, the number of frags he/she has and the number of deaths.

Parameters:
pi - the PlayerInfo for that player

getLineCount

public int getLineCount()
Returns the number of lines in the table.

Returns:
int the number of lines

getPlayerName

public java.lang.String getPlayerName(int i)
Gets the name of the player in i-th line.

Parameters:
i - the line number
Returns:
String the name

getFrags

public int getFrags(int i)
Gets the number of frags in i-th line.

Parameters:
i - the line number
Returns:
int the number

getKilled

public int getKilled(int i)
Gets the number of deaths in i-th line.

Parameters:
i - the line number
Returns:
int the number

getContainer

public DataContainer getContainer()
Creates a DataContainer from the table's content that can be transfered via the network.

Returns:
DataContainer the container with the table's data

addToContainer

public void addToContainer(InfoDataContainer dc)
Adds the table's content to an existing container. This container isn't a generic DataContainer any longer, but a specific InfoDataContainer

Parameters:
dc - the container