24 #include <boost/uuid/uuid.hpp> 26 #include "../Display/Color.h" 27 #include "../Display/Res.h" 30 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 32 # define MR_DllDeclare __declspec( dllexport ) 34 # define MR_DllDeclare __declspec( dllimport ) 37 # define MR_DllDeclare 61 Profile(std::shared_ptr<AvatarGallery> avatarGallery = {});
62 Profile(std::shared_ptr<AvatarGallery> avatarGallery,
63 const boost::uuids::uuid &uid) :
64 Profile(avatarGallery, uid,
"Player", {},
67 Profile(std::shared_ptr<AvatarGallery> avatarGallery,
68 const boost::uuids::uuid &uid,
const std::string &name,
69 const std::string &avatarName,
71 avatarGallery(
std::move(avatarGallery)),
72 uid(uid), name(name), avatarName(avatarName),
73 primaryColor(primaryColor), secondaryColor(secondaryColor) { }
84 const boost::uuids::uuid &
GetUid()
const {
return uid; }
86 const std::string GetUidStr()
const;
92 const std::string &
GetName()
const {
return name; }
94 virtual void SetName(
const std::string &name);
99 void SetAvatarName(
const std::string &avatarName)
override;
116 void Rename(
const std::string &name)
override { SetName(name); }
119 virtual std::shared_ptr<Display::Res<Display::Texture>>
138 virtual void Save() = 0;
141 static const size_t MAX_NAME_LENGTH = 30;
142 static const size_t MAX_AVATAR_NAME_LENGTH = 16;
std::string avatarName
Definition: Profile.h:147
void Rename(const std::string &name) override
Attempt to rename the profile.
Definition: Profile.h:116
Display::Color GetPrimaryColor() const
Definition: Profile.h:106
constexpr Color COLOR_WHITE
Definition: Color.h:64
AvatarGallery * GetAvatarGallery() const
Definition: Profile.h:77
const boost::uuids::uuid & GetUid() const
Retrieve the globally unique identifier for this profile.
Definition: Profile.h:84
const std::string & GetName() const
Retrieve the name of the player.
Definition: Profile.h:92
virtual EditableProfile * Edit()
Retrieve an editable view of this profile.
Definition: Profile.h:128
Display::Color secondaryColor
Definition: Profile.h:149
const std::string & GetAvatarName() const
Definition: Profile.h:97
std::string name
Definition: Profile.h:146
virtual RenamableProfile * EditName()
Retrieve an renamable view of this profile.
Definition: Profile.h:135
Display::Color primaryColor
Definition: Profile.h:148
std::shared_ptr< AvatarGallery > avatarGallery
Definition: Profile.h:144
virtual ~Profile()
Definition: Profile.h:74
The collection of built-in avatars.
Definition: AvatarGallery.h:50
Profile(std::shared_ptr< AvatarGallery > avatarGallery, const boost::uuids::uuid &uid)
Definition: Profile.h:62
Interface for profiles than can be renamed.
Definition: EditableProfile.h:59
#define MR_DllDeclare
Definition: Profile.h:37
Base class for player profiles.
Definition: Profile.h:56
Definition: Announcement.h:24
constexpr Color COLOR_BLACK
Definition: Color.h:65
Display::Color GetSecondaryColor() const
Definition: Profile.h:111
boost::uuids::uuid uid
Definition: Profile.h:145
Interface for profile editing.
Definition: EditableProfile.h:43
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)
Definition: Profile.h:67