org.comedia.game
Class CHighScores

java.lang.Object
  |
  +--org.comedia.game.CHighScores

public class CHighScores
extends java.lang.Object

Presents a table of high scores for game beans.


Field Summary
static int MAX_SCORES
          The maximum table length.
 
Constructor Summary
CHighScores()
          Constructs this table with default values.
 
Method Summary
 void addScore(java.lang.String player, int score)
          Adds a new score into this table
 void clear()
          Clears this score table.
 java.lang.String formatScore(int index, int length)
          Formats a score by specified index.
 int getLength()
          Gets the current table length.
 int getMinimumScore()
          Gets the minimum score in the table.
 java.lang.String getPlayerName(int index)
          Gets payer name by index.
 int getPlayerScore(int index)
          Gets payer score by index.
 boolean isFull()
          Checks if this table full.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SCORES

public static final int MAX_SCORES
The maximum table length.
Constructor Detail

CHighScores

public CHighScores()
Constructs this table with default values.
Method Detail

getLength

public int getLength()
Gets the current table length.

getPlayerName

public java.lang.String getPlayerName(int index)
Gets payer name by index.
Parameters:
index - an index of a player.

getPlayerScore

public int getPlayerScore(int index)
Gets payer score by index.
Parameters:
index - an index of a player.

getMinimumScore

public int getMinimumScore()
Gets the minimum score in the table.

isFull

public boolean isFull()
Checks if this table full.

clear

public void clear()
Clears this score table.

addScore

public void addScore(java.lang.String player,
                     int score)
Adds a new score into this table

formatScore

public java.lang.String formatScore(int index,
                                    int length)
Formats a score by specified index.
Parameters:
index - a score index.
length - a player name length.