19 #ifndef HEADER_HIGHSCORES_HPP
20 #define HEADER_HIGHSCORES_HPP
26 #include "race/race_manager.hpp"
28 #include "irrString.h"
30 using namespace irr::core;
57 typedef std::string HighscoreType;
59 enum {HIGHSCORE_LEN = 5};
61 HighscoreType m_highscore_type;
62 int m_number_of_karts;
66 int m_gp_reverse_type;
70 std::array<std::string, HIGHSCORE_LEN> m_kart_name;
71 std::array<stringw, HIGHSCORE_LEN> m_name;
72 std::array<float, HIGHSCORE_LEN> m_time;
74 static SortOrder m_sort_order;
76 int findHighscorePosition(
const std::string& kart_name,
77 const core::stringw& name,
const float time);
82 static bool compare(
const std::unique_ptr<Highscores>& a,
const std::unique_ptr<Highscores>& b) {
return (*a < *b); }
85 Highscores (
const Highscores::HighscoreType &highscore_type,
87 const std::string &trackName,
const int number_of_laps,
91 const std::string &trackName,
const int target,
97 void readEntry (
const XMLNode &node);
101 int matches (
const HighscoreType &highscore_type,
int num_karts,
103 const std::string &track,
const int number_of_laps,
107 int matches(
int num_karts,
109 const std::string &track,
const int target,
112 int addData (
const std::string& kart_name,
113 const irr::core::stringw& name,
const float time);
114 int addGPData (
const std::string& kart_name,
115 const irr::core::stringw& name, std::string gp_name,
const float time);
117 int getNumberEntries()
const;
119 void getEntry (
int number, std::string &kart_name,
120 irr::core::stringw &name,
float *
const time)
const;
122 static void setSortOrder(SortOrder so) { m_sort_order = so; }
GPReverseType
Used to define the reverse setting when creating a random GP: No reverse, all reverse (if available o...
Definition: grand_prix_data.hpp:91
Represents one highscore entry, i.e.
Definition: highscores.hpp:41
SortOrder
Order of sort for Highscores.
Definition: highscores.hpp:45
MinorRaceModeType
Minor variants to the major types of race.
Definition: race_manager.hpp:111
Difficulty
Game difficulty.
Definition: race_manager.hpp:231
utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files
Definition: utf_writer.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48