Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeaderBoard ¶
type LeaderBoard struct {
Records []*Record `json:"records"`
}
LeaderBoard is a collection of records
func LoadHighScores ¶
func LoadHighScores() *LeaderBoard
LoadHighScores from the scores.json file into a leaderboard
func (LeaderBoard) DeterminePosition ¶
func (l LeaderBoard) DeterminePosition(score int) int
DeterminePosition takes the score and determines what position on the leaderboard it is. Returns -1 if the score does not fall on the leaderboard
func (*LeaderBoard) SaveHighScores ¶
func (l *LeaderBoard) SaveHighScores() bool
SaveHighScores of the leaderboard to a json file
func (*LeaderBoard) SetPosition ¶
func (l *LeaderBoard) SetPosition(index int, name string, score int) bool
SetPosition of the new Record at the given position in the leaderboard
Click to show internal directories.
Click to hide internal directories.