19 #ifndef HEADER_TRACK_MANAGER_HPP
20 #define HEADER_TRACK_MANAGER_HPP
22 #include "config/favorite_status.hpp"
50 typedef std::vector<Track*> Tracks;
55 typedef std::map<std::string, std::vector<int> > Group2Indices;
76 Group2Indices m_arena_groups_no_custom;
77 Group2Indices m_soccer_arena_groups_no_custom;
87 void updateGroups(TrackGroupType type,
const Track* track);
93 static void removeTrackSearchDirs();
109 bool loadTrack(
const std::string& dirname);
132 const std::vector<std::string>&
145 int getTrackIndexByIdent(
const std::string& ident)
const;
160 const std::vector<int>&
166 void onDemandLoadTrackScreenshots();
168 void updateScreenshotCache();
Class for storing the current favorites/custom groups of karts and tracks.
Definition: favorite_status.hpp:43
Simple class to load and manage track data, track names and such.
Definition: track_manager.hpp:35
Track * getTrack(unsigned int index) const
Returns the track with a given index number.
Definition: track_manager.hpp:143
void updateAllGroups(const Track *track)
Updates the groups after a track was read in.
Definition: track_manager.cpp:372
std::vector< std::string > m_all_track_dirs
All directories in which tracks were found.
Definition: track_manager.hpp:48
~TrackManager()
Delete all tracks.
Definition: track_manager.cpp:53
std::vector< std::string > m_soccer_arena_group_names
List of the names of all groups containing soccer arenas.
Definition: track_manager.hpp:72
void setFavoriteTrackStatus(FavoriteStatus *status)
Adds a track to the special group of favorite tracks.
Definition: track_manager.cpp:436
std::vector< std::string > getAllTrackIdentifiers()
Returns a list of all track identifiers.
Definition: track_manager.cpp:140
Track * getTrack(const std::string &ident) const
Get TrackData by the track identifier.
Definition: track_manager.cpp:94
void clearFavoriteTrackStatus()
Clears the list of active favorite tracks, used e.g.
Definition: track_manager.cpp:495
std::vector< bool > m_track_avail
Flag if this track is available or not.
Definition: track_manager.hpp:82
TrackManager()
Constructor (currently empty).
Definition: track_manager.cpp:45
Group2Indices m_track_groups_no_custom
Same as above but without user-defined groups.
Definition: track_manager.hpp:75
std::vector< std::string > m_track_group_names
List of the names of all groups containing tracks.
Definition: track_manager.hpp:66
void setUnavailableTracks(const std::vector< std::string > &tracks)
Sets a list of track as being unavailable (e.g.
Definition: track_manager.cpp:121
Tracks m_tracks
All track objects.
Definition: track_manager.hpp:53
Group2Indices m_track_groups
List of all track indexes for each racing track group.
Definition: track_manager.hpp:57
const std::vector< std::string > * getAllTrackDirs() const
Returns a list of all directories that contain a track.
Definition: track_manager.hpp:120
Group2Indices m_arena_groups
List of all arena indexes for each arena group.
Definition: track_manager.hpp:60
void removeTrack(const std::string &ident)
Removes a track.
Definition: track_manager.cpp:245
void removeAllCachedData()
Removes all cached data from all tracks.
Definition: track_manager.cpp:110
const std::vector< int > & getTracksInGroup(const std::string &g)
Returns a list of all tracks in a given group.
Definition: track_manager.hpp:153
const std::vector< int > & getArenasInGroup(const std::string &g, bool soccer_arena=false)
Returns a list of all arenas in a given group.
Definition: track_manager.hpp:161
std::vector< std::string > m_arena_group_names
List of the names of all groups containing arenas.
Definition: track_manager.hpp:69
size_t getNumberOfTracks() const
Returns the number of tracks.
Definition: track_manager.hpp:139
void removeTrackFromGroups(TrackGroupType type, const Track *track)
Remove the track from all groups it belongs to in a group type.
Definition: track_manager.cpp:304
bool loadTrack(const std::string &dirname)
Tries to load a track from a single directory.
Definition: track_manager.cpp:203
Group2Indices m_soccer_arena_groups
List of all soccer arena indexes for each soccer arena group.
Definition: track_manager.hpp:63
bool isAvailable(unsigned int n) const
Checks if a certain track is available.
Definition: track_manager.hpp:149
const std::vector< std::string > & getAllArenaGroups(bool soccer_arena=false) const
Returns a list of the names of all used arena groups.
Definition: track_manager.hpp:133
int getNumberOfRaceTracks() const
Returns the number of racing tracks.
Definition: track_manager.cpp:80
const std::vector< std::string > & getAllTrackGroups() const
Returns a list of the names of all used track groups.
Definition: track_manager.hpp:126
void loadTrackList()
Load all .track files from all directories.
Definition: track_manager.cpp:153
static std::vector< std::string > m_track_search_path
All directories in which tracks are searched.
Definition: track_manager.hpp:45
static void addTrackSearchDir(const std::string &dir)
Adds a directory from which tracks are loaded.
Definition: track_manager.cpp:71
Definition: track.hpp:115