19#ifndef HEADER_HIGHSCORES_HPP
20#define HEADER_HIGHSCORES_HPP
26#include "race/race_manager.hpp"
30using namespace irr::core;
47 SO_TRACK = SO_DEFAULT,
54 typedef std::string HighscoreType;
56 enum {HIGHSCORE_LEN = 5};
58 HighscoreType m_highscore_type;
59 int m_number_of_karts;
63 int m_gp_reverse_type;
67 std::array<std::string, HIGHSCORE_LEN> m_kart_name;
68 std::array<stringw, HIGHSCORE_LEN> m_name;
69 std::array<float, HIGHSCORE_LEN> m_time;
73 int findHighscorePosition(
const std::string& kart_name,
74 const core::stringw& name,
const float time);
79 static bool compare(
const std::unique_ptr<Highscores>& a,
const std::unique_ptr<Highscores>& b) {
return (*a < *b); }
82 Highscores (
const Highscores::HighscoreType &highscore_type,
84 const std::string &trackName,
const int number_of_laps,
88 const std::string &trackName,
const int target,
94 void readEntry (
const XMLNode &node);
98 int matches (
const HighscoreType &highscore_type,
int num_karts,
100 const std::string &track,
const int number_of_laps,
104 int matches(
int num_karts,
106 const std::string &track,
const int target,
109 int addData (
const std::string& kart_name,
110 const irr::core::stringw& name,
const float time);
111 int addGPData (
const std::string& kart_name,
112 const irr::core::stringw& name, std::string gp_name,
const float time);
114 int getNumberEntries()
const;
116 void getEntry (
int number, std::string &kart_name,
117 irr::core::stringw &name,
float *
const time)
const;
119 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:89
Represents one highscore entry, i.e.
Definition: highscores.hpp:41
SortOrder
Order of sort for Highscores.
Definition: highscores.hpp:45
void writeEntry(UTFWriter &writer)
Writes the highscores in this entry to the writer.
Definition: highscores.cpp:151
int addData(const std::string &kart_name, const irr::core::stringw &name, const float time)
Inserts the data into the highscore list.
Definition: highscores.cpp:249
MinorRaceModeType
Minor variants to the major types of race.
Definition: race_manager.hpp:110
Difficulty
Game difficulty.
Definition: race_manager.hpp:230
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