HoverRace  2.0
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Player::AvatarGallery Class Reference

The collection of built-in avatars. More...

#include <AvatarGallery.h>

Public Types

using const_iterator = avatars_t::const_iterator
 
using iterator = avatars_t::iterator
 
using value_type = avatars_t::value_type
 

Public Member Functions

 AvatarGallery (const Util::OS::path_t &path={})
 Constructor. More...
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
std::shared_ptr< Display::Res< Display::Texture > > FindName (const std::string &s) const
 Find the avatar for a given name. More...
 
bool IsEmpty () const
 
void Reload ()
 Reload all avatars. More...
 

Static Public Member Functions

static const std::string & GetDefaultAvatarName ()
 Retrieve the name of the default avatar. More...
 

Private Types

using avatars_t = std::unordered_map< std::string, std::shared_ptr< Display::Res< Display::Texture >>>
 

Private Attributes

avatars_t avatars
 
Util::OS::path_t path
 

Detailed Description

The collection of built-in avatars.

Author
Michael Imamura

Member Typedef Documentation

using HoverRace::Player::AvatarGallery::avatars_t = std::unordered_map< std::string, std::shared_ptr<Display::Res<Display::Texture>>>
private
using HoverRace::Player::AvatarGallery::const_iterator = avatars_t::const_iterator
using HoverRace::Player::AvatarGallery::iterator = avatars_t::iterator
using HoverRace::Player::AvatarGallery::value_type = avatars_t::value_type

Constructor & Destructor Documentation

HoverRace::Player::AvatarGallery::AvatarGallery ( const Util::OS::path_t path = { })

Constructor.

Parameters
pathThe base avatar directory (may be empty to use default).

Member Function Documentation

const_iterator HoverRace::Player::AvatarGallery::begin ( ) const
inline
iterator HoverRace::Player::AvatarGallery::begin ( )
inline
const_iterator HoverRace::Player::AvatarGallery::end ( ) const
inline
iterator HoverRace::Player::AvatarGallery::end ( )
inline
std::shared_ptr< Display::Res< Display::Texture > > HoverRace::Player::AvatarGallery::FindName ( const std::string &  s) const

Find the avatar for a given name.

Parameters
sThe avatar name.
Returns
The avatar, or nullptr if not found.
const std::string & HoverRace::Player::AvatarGallery::GetDefaultAvatarName ( )
static

Retrieve the name of the default avatar.

Returns
The avatar name (never empty).
bool HoverRace::Player::AvatarGallery::IsEmpty ( ) const
inline
void HoverRace::Player::AvatarGallery::Reload ( )

Reload all avatars.

Member Data Documentation

avatars_t HoverRace::Player::AvatarGallery::avatars
private
Util::OS::path_t HoverRace::Player::AvatarGallery::path
private

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