jurpe.game.session
Class HighScores

java.lang.Object
  extended by jurpe.game.session.HighScores
All Implemented Interfaces:
java.io.Serializable

public class HighScores
extends java.lang.Object
implements java.io.Serializable

Container type for High Scores.

See Also:
Serialized Form

Constructor Summary
HighScores()
          Constructor. 20 rows.
HighScores(int maxRows)
          Constructor.
 
Method Summary
 boolean addToScore(jurpe.game.session.Score nsc)
          Add a new Score to current High Score Table.
 boolean addToScore(java.lang.String name, int points)
          Add a new Score to current High Score Table.
 java.lang.Object[][] getHighScores()
          Get High Scores as an array made of Name,Date,Score.
static void main(java.lang.String[] args)
          Deprecated.  
 void save(java.lang.String filename)
          Saves actual HighScores
 void setDefaultHighScores()
          Add default high scores to High Score table.
 java.lang.String toString()
          String that represents the high score table
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HighScores

public HighScores(int maxRows)
Constructor.

Parameters:
maxRows - Max Number of entries this High Score Table can contain

HighScores

public HighScores()
Constructor. 20 rows.

Method Detail

addToScore

public boolean addToScore(jurpe.game.session.Score nsc)
Add a new Score to current High Score Table. Since scores is a Sorted Set, it will enter in the correct sorted place.

Parameters:
nsc - Score to add
Returns:
true, if this scores enters the High Score table.

addToScore

public boolean addToScore(java.lang.String name,
                          int points)
Add a new Score to current High Score Table. Since scores is a Sorted Set, it will enter in the correct sorted place.

Parameters:
name - Name of PCharacter
points - Final score of PCharacter
Returns:
true, if this scores enters the High Score table.

toString

public java.lang.String toString()
String that represents the high score table

Overrides:
toString in class java.lang.Object
Returns:
String that represents the high score table

getHighScores

public java.lang.Object[][] getHighScores()
Get High Scores as an array made of Name,Date,Score. Array is sorted from best to worst score.

Returns:
double array to use with Swing Tables.

setDefaultHighScores

public void setDefaultHighScores()
Add default high scores to High Score table.


save

public void save(java.lang.String filename)
Saves actual HighScores

Parameters:
filename - complete name and path of file

main

public static void main(java.lang.String[] args)
Deprecated. 

For test purposes only.

Parameters:
args -

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net