SuperTuxKart
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
FavoriteStatus Class Reference

Class for storing the current favorites/custom groups of karts and tracks. More...

#include <favorite_status.hpp>

Public Member Functions

 FavoriteStatus (const XMLNode *node, std::string parse_type)
 Parse all <(parse_type)/> in <favorite> in xml node.
 
void save (UTFWriter &out)
 Writes the data for this player to the specified UTFWriter. More...
 
bool isFavorite (std::string ident)
 Adds a new favorite track to this player profile and to the group of favorite tracks of the Track Manager. More...
 
void addFavorite (std::string ident, std::string group=DEFAULT_FAVORITE_GROUP_NAME)
 Adds a new favorite track to this player profile and to the group of favorite tracks of the Track Manager.
 
void removeFavorite (std::string ident, std::string group=DEFAULT_FAVORITE_GROUP_NAME)
 Removes a favorite track from this player profile and from the group of favorite tracks of the Track Manager.
 
const std::unordered_map< std::string, std::set< std::string > > & getAllFavorites () const
 

Static Public Attributes

static const std::string DEFAULT_FAVORITE_GROUP_NAME = "Favorites"
 

Private Attributes

std::string m_parse_type
 
std::unordered_map< std::string, std::set< std::string > > m_favorite
 unordered_map<Group Name, set<Track Name> > .
 

Detailed Description

Class for storing the current favorites/custom groups of karts and tracks.

Put it into KartPropertiesManager or TrackManager by setFavoriteStatus() to add them into the original groups.

Member Function Documentation

◆ isFavorite()

bool FavoriteStatus::isFavorite ( std::string  ident)

Adds a new favorite track to this player profile and to the group of favorite tracks of the Track Manager.

To be used only if this player profile is the current player.

◆ save()

void FavoriteStatus::save ( UTFWriter out)

Writes the data for this player to the specified UTFWriter.

Parameters
outThe utf writer to write the data to.

The documentation for this class was generated from the following files: