java.io.Serializablepublic class Leaderboard extends java.util.TreeSet<GamePlayed> implements java.io.Serializable
| Constructor | Description |
|---|---|
Leaderboard() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(java.lang.String name,
java.util.Date d,
int score) |
Add function that creates a GamePlayed object and adds it to the Leaderboard in the proper spot
|
java.lang.String |
getPlayerTopThree(java.lang.String playerName) |
returns a formatted string of the top three scores for a player
|
java.lang.String |
getTopThree() |
returns a formatted string of the top three all time highest scores
|
void |
load() |
Loads the Leaderboard ArrayList from the .ser file
|
void |
save() |
Saves the Leaderboard ArrayList in .ser file
|
void |
setFileName(java.lang.String fileName) |
Setter for filename
|
containsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitpublic void setFileName(java.lang.String fileName)
fileName - - represents the new filename of the .ser filepublic boolean add(java.lang.String name,
java.util.Date d,
int score)
name - - represents the name of the playerd - - represents the date of the gamescore - - represents the player's scorepublic void save()
public void load()
public java.lang.String getTopThree()
public java.lang.String getPlayerTopThree(java.lang.String playerName)
playerName - of the player