com.planeth.gtroids.highscores
Class HighScoreManager

java.lang.Object
  extended bycom.planeth.gtroids.highscores.HighScoreManager

public class HighScoreManager
extends java.lang.Object

Handles the HighScoreList
(Singleton pattern)

Author:
Andreas Grässer, gal@planet-h.com.
created 14.11.2005
See Also:
HighScore

Field Summary
static int MAX_NAME_LENGTH
           
 
Method Summary
 void addHighScore(java.lang.String player, int score)
          Adds a HighScore to the list and stores the List on the predefined place
 java.util.List getHighScoreList()
          Returns the highScoreList.
 java.lang.String getHighScoresAsString()
          Returns the highScoreList as String
static HighScoreManager getInstance()
          Returns the singleton instance
 int getPositon(int score)
          Returns the temporary position for the passed score in the highScoreList
The definitive positon isn't available until the score is saved.
 boolean isValidHighScore(int score)
          Returns true, if the passed score is a valid highScore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NAME_LENGTH

public static final int MAX_NAME_LENGTH
See Also:
Constant Field Values
Method Detail

getInstance

public static HighScoreManager getInstance()
Returns the singleton instance

Returns:
Returns the singleton instance

isValidHighScore

public boolean isValidHighScore(int score)
Returns true, if the passed score is a valid highScore

Parameters:
score - the score to check
Returns:
Returns true, if the passed score is a valid highScore

getPositon

public int getPositon(int score)
Returns the temporary position for the passed score in the highScoreList
The definitive positon isn't available until the score is saved.

Parameters:
score - the score to check
Returns:
Returns the temporary position for the passed score in the highScoreList

addHighScore

public void addHighScore(java.lang.String player,
                         int score)
Adds a HighScore to the list and stores the List on the predefined place

Parameters:
player - player's name
score - player's score

getHighScoresAsString

public java.lang.String getHighScoresAsString()
Returns the highScoreList as String

Returns:
Returns the highScoreList as String

getHighScoreList

public java.util.List getHighScoreList()
Returns the highScoreList.

Returns:
Returns the highScoreList.