|
HoverRace
2.0
|
Base class for player profiles. More...
#include <Profile.h>
Inheritance diagram for HoverRace::Player::Profile:Public Member Functions | |
| Profile (std::shared_ptr< AvatarGallery > avatarGallery={}) | |
| Profile (std::shared_ptr< AvatarGallery > avatarGallery, const boost::uuids::uuid &uid) | |
| Profile (std::shared_ptr< AvatarGallery > avatarGallery, const boost::uuids::uuid &uid, const std::string &name, const std::string &avatarName, Display::Color primaryColor, Display::Color secondaryColor) | |
| virtual | ~Profile () |
| virtual EditableProfile * | Edit () |
| Retrieve an editable view of this profile. More... | |
| virtual RenamableProfile * | EditName () |
| Retrieve an renamable view of this profile. More... | |
| virtual std::shared_ptr< Display::Res< Display::Texture > > | GetAvatar () const |
| Retrieve the user's avatar, if available. More... | |
| const std::string & | GetAvatarName () const |
| Display::Color | GetColor (size_t i) const |
| Retrieve the color by index. More... | |
| const std::string & | GetName () const |
| Retrieve the name of the player. More... | |
| Display::Color | GetPrimaryColor () const |
| Display::Color | GetSecondaryColor () const |
| const boost::uuids::uuid & | GetUid () const |
| Retrieve the globally unique identifier for this profile. More... | |
| const std::string | GetUidStr () const |
| Retrieve the UID as a string. More... | |
| void | SetColor (size_t i, Display::Color color) override |
| Set the color by index. More... | |
Static Public Attributes | |
| static const size_t | MAX_AVATAR_NAME_LENGTH = 16 |
| static const size_t | MAX_NAME_LENGTH = 30 |
| Maximum length for the name. More... | |
Protected Member Functions | |
| AvatarGallery * | GetAvatarGallery () const |
| void | Rename (const std::string &name) override |
| Attempt to rename the profile. More... | |
| virtual void | Save ()=0 |
| void | SetAvatarName (const std::string &avatarName) override |
| virtual void | SetName (const std::string &name) |
| void | SetPrimaryColor (Display::Color color) override |
| void | SetSecondaryColor (Display::Color color) override |
Private Attributes | |
| std::shared_ptr< AvatarGallery > | avatarGallery |
| std::string | avatarName |
| std::string | name |
| Display::Color | primaryColor |
| Display::Color | secondaryColor |
| boost::uuids::uuid | uid |
Base class for player profiles.
| HoverRace::Player::Profile::Profile | ( | std::shared_ptr< AvatarGallery > | avatarGallery = {} | ) |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Retrieve an editable view of this profile.
nullptr if this profile cannot be edited. Reimplemented in HoverRace::Player::LocalProfile.
|
inlinevirtual |
Retrieve an renamable view of this profile.
nullptr if this profile cannot change the name. Reimplemented in HoverRace::Player::LocalProfile.
|
virtual |
Retrieve the user's avatar, if available.
nullptr). Reimplemented in HoverRace::Player::LocalProfile, and HoverRace::Player::DemoProfile.
|
inlineprotected |
|
inline |
| Display::Color HoverRace::Player::Profile::GetColor | ( | size_t | i | ) | const |
Retrieve the color by index.
| i | The color index (starts at zero). |
|
inline |
Retrieve the name of the player.
|
inline |
|
inline |
|
inline |
Retrieve the globally unique identifier for this profile.
nil if uninitialized). | const std::string HoverRace::Player::Profile::GetUidStr | ( | ) | const |
Retrieve the UID as a string.
|
inlineoverrideprotectedvirtual |
Attempt to rename the profile.
This implies saving the profile.
| name | The new name (may not be blank). |
Implements HoverRace::Player::RenamableProfile.
|
protectedpure virtual |
Implements HoverRace::Player::EditableProfile.
Implemented in HoverRace::Player::LocalProfile, and HoverRace::Player::DemoProfile.
|
overrideprotectedvirtual |
Implements HoverRace::Player::EditableProfile.
|
overridevirtual |
Set the color by index.
| i | The color index (starts at zero). |
| color | The color to set. |
Implements HoverRace::Player::EditableProfile.
|
protectedvirtual |
|
overrideprotectedvirtual |
Implements HoverRace::Player::EditableProfile.
|
overrideprotectedvirtual |
Implements HoverRace::Player::EditableProfile.
|
private |
|
private |
|
static |
|
static |
Maximum length for the name.
Length is in Unicode code points (not bytes!).
|
private |
|
private |
|
private |
|
private |
1.8.11