19#ifndef HEADER_HIGHSCORE_MANAGER_HPP
20#define HEADER_HIGHSCORE_MANAGER_HPP
27#include "race/highscores.hpp"
39 static const unsigned int CURRENT_HSCORE_FILE_VERSION;
40 std::vector<std::unique_ptr<Highscores> > m_all_scores;
42 std::string m_filename;
51 void loadHighscores();
53 void saveHighscores();
55 Highscores *getHighscores(
const Highscores::HighscoreType &highscore_type,
58 const std::string &trackName,
59 const int number_of_laps,
65 const std::string &trackName,
70 void deleteHighscores(
int i) { m_all_scores.erase
71 (m_all_scores.begin() + i); }
73 void clearHighscores() { m_all_scores.clear(); }
75 bool highscoresEmpty() {
return m_all_scores.empty(); }
77 Highscores* getHighscoresAt(
int i) {
return m_all_scores.at(i).get(); }
79 int highscoresSize() {
return m_all_scores.size(); }
81 void sortHighscores(
bool reverse)
83 (reverse ? std::stable_sort(m_all_scores.rbegin(),
84 m_all_scores.rend(), Highscores::compare) :
85 std::stable_sort(m_all_scores.begin(),
86 m_all_scores.end(), Highscores::compare));
GPReverseType
Used to define the reverse setting when creating a random GP: No reverse, all reverse (if available o...
Definition: grand_prix_data.hpp:89
This class reads and writes the 'highscores.xml' file, and also takes care of dealing with new record...
Definition: highscore_manager.hpp:36
void setFilename()
Determines the path to store the highscore file in.
Definition: highscore_manager.cpp:55
Highscores * getGPHighscores(int num_karts, const RaceManager::Difficulty difficulty, const std::string &trackName, const int target, GrandPrixData::GPReverseType reverse_type, RaceManager::MinorRaceModeType minor_mode)
getHighscores method for grandprix highscores
Definition: highscore_manager.cpp:209
Represents one highscore entry, i.e.
Definition: highscores.hpp:41
MinorRaceModeType
Minor variants to the major types of race.
Definition: race_manager.hpp:110
Difficulty
Game difficulty.
Definition: race_manager.hpp:230