public class Scoreboard
extends java.lang.Object
| Constructor and Description |
|---|
Scoreboard()
Initiates the scoreboard with the database and the id random source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addScore(Score score)
Adds a score to the database.
|
void |
clear()
Clears the score database
|
java.util.List<Score> |
getScores(int numberOfItems)
Gets the top scores.
|
int |
numScores()
Gets the number of scores in the database.
|
public Scoreboard()
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<Score> getScores(int numberOfItems) throws java.io.IOException
numberOfItems - The maximum number of scores to
retrievejava.io.IOException - when reading the scores file failspublic void addScore(Score score) throws java.io.IOException
score - the score to addjava.io.IOExceptionpublic int numScores()
throws java.io.IOException
java.io.IOException - when reading the scores list failspublic void clear()
throws java.io.IOException
java.io.IOException - when saving the scores list fails