Byggern
Highscore::Highscore Class Reference

Keeps track of the highscore and stores it to the EEPROM. More...

#include <highscore.h>

Public Member Functions

 Highscore ()
 
void SaveScore (Score &score)
 
void StoreScores ()
 
void LoadScores ()
 
uint8_t GetHighscores (uint8_t first, Score **&scores)
 
void ClearHighscores ()
 

Private Attributes

Score ** score
 
uint8_t length = 0
 

Detailed Description

Keeps track of the highscore and stores it to the EEPROM.

The Highscore class keeps track of the highscores, and provides a method for saving them to the EEPROM for persistent storage.

Constructor & Destructor Documentation

§ Highscore()

Highscore::Highscore::Highscore ( )

Automatically loads highscores from EEPROM.

Member Function Documentation

§ ClearHighscores()

void Highscore::Highscore::ClearHighscores ( )

Clears the list of highscores. Of course, this does not clear the stored highscore list from the EEPROM. If you want to clear the EEPROM, please run ClearHighscores() followed by StoreScores().

§ GetHighscores()

uint8_t Highscore::Highscore::GetHighscores ( uint8_t  first,
Score **&  scores 
)

Returns an array of highscores

Parameters
firstThe first highscore to return by index.
scoresThe array to change to point to the highscore list.
Returns
The length of the highscore list.

§ LoadScores()

void Highscore::Highscore::LoadScores ( )

Loads the highscore list from the EEPROM.

§ SaveScore()

void Highscore::Highscore::SaveScore ( Score score)

Saves the score to the highscore list.

Parameters
scoreThe score to save.

§ StoreScores()

void Highscore::Highscore::StoreScores ( )

Store the highscore list to the EEPROM. This can take a few seconds.

Member Data Documentation

§ length

uint8_t Highscore::Highscore::length = 0
private

Length of the score variable.

§ score

Score** Highscore::Highscore::score
private

Contains a sorted list of scores.


The documentation for this class was generated from the following file: