stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::HighscoresLoader Class Referenceabstract
Inheritance diagram for stmg::HighscoresLoader:
Inheritance graph
[legend]

Public Member Functions

virtual ~HighscoresLoader () noexcept=default
 
virtual std::vector< shared_ptr< Highscore > > getHighscores (const std::string &sGameName, const shared_ptr< HighscoresDefinition > &refHighscoresDefinition) const noexcept=0
 Get all the currently available highscores for a game. More...
 
virtual shared_ptr< HighscoregetHighscore (const std::string &sGameName, const AppPreferences &oPreferences, const shared_ptr< HighscoresDefinition > &refHighscoresDefinition) const noexcept=0
 Get the highscore for the game (prefs) and the highscores definition. More...
 
virtual bool updateHighscore (const std::string &sGameName, const AppPreferences &oPreferences, const Highscore &oHighscore) noexcept=0
 Persist the highscores for a game. More...
 

Constructor & Destructor Documentation

◆ ~HighscoresLoader()

virtual stmg::HighscoresLoader::~HighscoresLoader ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getHighscore()

virtual shared_ptr<Highscore> stmg::HighscoresLoader::getHighscore ( const std::string &  sGameName,
const AppPreferences oPreferences,
const shared_ptr< HighscoresDefinition > &  refHighscoresDefinition 
) const
pure virtualnoexcept

Get the highscore for the game (prefs) and the highscores definition.

Parameters
sGameNameThe game name. Cannot be empty.
oPreferencesThe preferences.
refHighscoresDefinitionThe highscores definition. Cannot be null.
Returns
The highscores or null if there's no highscore for the game (type).

Implemented in stmg::XmlHighscoresLoader.

◆ getHighscores()

virtual std::vector<shared_ptr<Highscore> > stmg::HighscoresLoader::getHighscores ( const std::string &  sGameName,
const shared_ptr< HighscoresDefinition > &  refHighscoresDefinition 
) const
pure virtualnoexcept

Get all the currently available highscores for a game.

Parameters
sGameNameThe game name. Cannot be empty.
refHighscoresDefinitionThe highscores definition. Cannot be null.
Returns
The highscores for the game.

Implemented in stmg::XmlHighscoresLoader.

◆ updateHighscore()

virtual bool stmg::HighscoresLoader::updateHighscore ( const std::string &  sGameName,
const AppPreferences oPreferences,
const Highscore oHighscore 
)
pure virtualnoexcept

Persist the highscores for a game.

Parameters
sGameNameThe game name. Cannot be empty.
oPreferencesThe preferences.
oHighscoreThe highscore.
Returns
Whether the update was successful.

Implemented in stmg::XmlHighscoresLoader.