ManaPlus
Public Member Functions | Protected Attributes
Avatar Class Reference

#include <avatar.h>

Inheritance diagram for Avatar:
GuildMember PartyMember

Public Member Functions

 Avatar (const std::string &name)
 
virtual ~Avatar ()
 
std::string getName () const
 
void setName (const std::string &name)
 
std::string getOriginalName () const
 
std::string getComplexName () const
 
virtual std::string getAdditionString () const
 
void setOriginalName (const std::string &name)
 
bool getOnline () const
 
void setOnline (const bool online)
 
int getHp () const
 
void setHp (const int hp)
 
int getMaxHp () const
 
void setMaxHp (const int maxHp)
 
int getDamageHp () const
 
void setDamageHp (const int damageHp)
 
bool getDisplayBold () const
 
void setDisplayBold (const bool displayBold)
 
int getLevel () const
 
void setLevel (const int level)
 
std::string getMap () const
 
void setMap (const std::string &map)
 
int getX () const
 
void setX (const int x)
 
int getY () const
 
void setY (const int y)
 
int getType () const
 
void setType (const int n)
 
int getExp () const
 
void setExp (const int n)
 
BeingId getID () const
 
void setID (const BeingId id)
 
int getCharId () const
 
void setCharId (const int id)
 
GenderT getGender () const
 
void setGender (const GenderT g)
 
int getRace () const
 
void setRace (const int r)
 
const std::string & getIp () const
 
void setIp (const std::string &ip)
 
bool getPoison () const
 
void setPoison (const bool b)
 

Protected Attributes

BeingId mId
 
int mCharId
 
std::string mName
 
std::string mOriginalName
 
int mHp
 
int mMaxHp
 
int mDamageHp
 
int mLevel
 
std::string mMap
 
int mX
 
int mY
 
int mType
 
int mExp
 
GenderT mGender
 
int mRace
 
std::string mIp
 
bool mOnline
 
bool mDisplayBold
 
bool mPoison
 

Detailed Description

Definition at line 40 of file avatar.h.

Constructor & Destructor Documentation

◆ Avatar()

Avatar::Avatar ( const std::string &  name)
explicit

Definition at line 28 of file avatar.cpp.

28  :
30  mCharId(0),
31  mName(name),
32  mOriginalName(name),
33  mHp(0),
34  mMaxHp(0),
35  mDamageHp(0),
36  mLevel(1),
37  mMap(),
38  mX(-1),
39  mY(-1),
41  mExp(0),
43  mRace(-1),
44  mIp(),
45  mOnline(false),
46  mDisplayBold(false),
47  mPoison(false)
48 {
49 }
@ AVATAR_PLAYER
Definition: avatar.h:37
const BeingId BeingId_zero
Definition: beingid.h:30
std::string mOriginalName
Definition: avatar.h:190
bool mOnline
Definition: avatar.h:203
bool mPoison
Definition: avatar.h:205
std::string mMap
Definition: avatar.h:195
bool mDisplayBold
Definition: avatar.h:204
int mType
Definition: avatar.h:198
int mDamageHp
Definition: avatar.h:193
int mHp
Definition: avatar.h:191
GenderT mGender
Definition: avatar.h:200
int mX
Definition: avatar.h:196
int mMaxHp
Definition: avatar.h:192
std::string mName
Definition: avatar.h:189
int mCharId
Definition: avatar.h:188
int mLevel
Definition: avatar.h:194
int mExp
Definition: avatar.h:199
int mRace
Definition: avatar.h:201
std::string mIp
Definition: avatar.h:202
BeingId mId
Definition: avatar.h:187
int mY
Definition: avatar.h:197
@ UNSPECIFIED
Definition: gender.h:33

◆ ~Avatar()

virtual Avatar::~Avatar ( )
inlinevirtual

Definition at line 47 of file avatar.h.

48  { }

Member Function Documentation

◆ getAdditionString()

std::string Avatar::getAdditionString ( ) const
virtual

Reimplemented in GuildMember.

Definition at line 62 of file avatar.cpp.

63 {
64  if (!getIp().empty())
65  return " - " + getIp();
66  return "";
67 }
const std::string & getIp() const
Definition: avatar.h:174
std::string empty
Definition: podict.cpp:26

References empty, and getIp().

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getCharId()

int Avatar::getCharId ( ) const
inline

Definition at line 156 of file avatar.h.

157  { return mCharId; }

References mCharId.

Referenced by EAthena::GuildHandler::changeMemberPostion().

◆ getComplexName()

std::string Avatar::getComplexName ( ) const

Definition at line 51 of file avatar.cpp.

52 {
53  if (mName == mOriginalName ||
54  mOriginalName.empty())
55  {
56  return mName;
57  }
58  return std::string(mName).append("(").append(
59  mOriginalName).append(")");
60 }

References mName, and mOriginalName.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getDamageHp()

int Avatar::getDamageHp ( ) const
inline

Definition at line 102 of file avatar.h.

103  { return mDamageHp; }

References mDamageHp.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getDisplayBold()

bool Avatar::getDisplayBold ( ) const
inline

Definition at line 108 of file avatar.h.

109  { return mDisplayBold; }

References mDisplayBold.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getExp()

int Avatar::getExp ( ) const
inline

Definition at line 144 of file avatar.h.

145  { return mExp; }

References mExp.

◆ getGender()

GenderT Avatar::getGender ( ) const
inline

Definition at line 162 of file avatar.h.

163  { return mGender; }

References mGender.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getHp()

int Avatar::getHp ( ) const
inline

Definition at line 90 of file avatar.h.

91  { return mHp; }

References mHp.

Referenced by AvatarListBox::draw(), AvatarListBox::safeDraw(), and SocialPlayersTab::updateAvatar().

◆ getID()

BeingId Avatar::getID ( ) const
inline

Definition at line 150 of file avatar.h.

151  { return mId; }

References mId.

Referenced by EAthena::GuildHandler::changeMemberPostion(), EAthena::PartyHandler::kick(), and TmwAthena::PartyHandler::kick().

◆ getIp()

const std::string& Avatar::getIp ( ) const
inline

Definition at line 174 of file avatar.h.

175  { return mIp; }

References mIp.

Referenced by getAdditionString().

◆ getLevel()

int Avatar::getLevel ( ) const
inline

Definition at line 114 of file avatar.h.

115  { return mLevel; }

References mLevel.

Referenced by AvatarListBox::draw(), AvatarListBox::mousePressed(), and AvatarListBox::safeDraw().

◆ getMap()

std::string Avatar::getMap ( ) const
inline

Definition at line 120 of file avatar.h.

121  { return mMap; }

References mMap.

Referenced by AvatarListBox::draw(), Minimap::draw2(), AvatarListBox::safeDraw(), and PopupMenu::showPlayerPopup().

◆ getMaxHp()

int Avatar::getMaxHp ( ) const
inline

Definition at line 96 of file avatar.h.

97  { return mMaxHp; }

References mMaxHp.

Referenced by AvatarListBox::draw(), AvatarListBox::safeDraw(), and SocialPlayersTab::updateAvatar().

◆ getName()

std::string Avatar::getName ( ) const
inline

◆ getOnline()

bool Avatar::getOnline ( ) const
inline

◆ getOriginalName()

std::string Avatar::getOriginalName ( ) const
inline

Returns the avatar's original name.

Definition at line 65 of file avatar.h.

66  { return mOriginalName; }

References mOriginalName.

◆ getPoison()

bool Avatar::getPoison ( ) const
inline

Definition at line 180 of file avatar.h.

181  { return mPoison; }

References mPoison.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getRace()

int Avatar::getRace ( ) const
inline

Definition at line 168 of file avatar.h.

169  { return mRace; }

References mRace.

◆ getType()

int Avatar::getType ( ) const
inline

Definition at line 138 of file avatar.h.

139  { return mType; }

References mType.

Referenced by AvatarListBox::draw(), AvatarListBox::mousePressed(), and AvatarListBox::safeDraw().

◆ getX()

int Avatar::getX ( ) const
inline

◆ getY()

int Avatar::getY ( ) const
inline

◆ setCharId()

void Avatar::setCharId ( const int  id)
inline

Definition at line 159 of file avatar.h.

160  { mCharId = id; }

References mCharId.

Referenced by EAthena::GuildRecv::processGuildMemberList().

◆ setDamageHp()

void Avatar::setDamageHp ( const int  damageHp)
inline

Definition at line 105 of file avatar.h.

106  { mDamageHp = damageHp; }

References mDamageHp.

Referenced by SocialPlayersTab::resetDamage(), and SocialPlayersTab::updateAvatar().

◆ setDisplayBold()

void Avatar::setDisplayBold ( const bool  displayBold)
inline

Definition at line 111 of file avatar.h.

112  { mDisplayBold = displayBold; }

References mDisplayBold.

Referenced by PartyMember::setLeader().

◆ setExp()

void Avatar::setExp ( const int  n)
inline

Definition at line 147 of file avatar.h.

148  { mExp = n; }

References mExp.

Referenced by EAthena::GuildRecv::processGuildMemberList().

◆ setGender()

void Avatar::setGender ( const GenderT  g)
inline

◆ setHp()

void Avatar::setHp ( const int  hp)
inline

◆ setID()

void Avatar::setID ( const BeingId  id)
inline

Definition at line 153 of file avatar.h.

154  { mId = id; }

References mId.

Referenced by EAthena::GuildRecv::processGuildMemberList().

◆ setIp()

void Avatar::setIp ( const std::string &  ip)
inline

Definition at line 177 of file avatar.h.

178  { mIp = ip; }

References mIp.

Referenced by SocialPlayersTab::updateAvatar().

◆ setLevel()

void Avatar::setLevel ( const int  level)
inline

◆ setMap()

void Avatar::setMap ( const std::string &  map)
inline

◆ setMaxHp()

void Avatar::setMaxHp ( const int  maxHp)
inline

◆ setName()

void Avatar::setName ( const std::string &  name)
inline

◆ setOnline()

void Avatar::setOnline ( const bool  online)
inline

◆ setOriginalName()

void Avatar::setOriginalName ( const std::string &  name)
inline

Set the avatar's original name.

Definition at line 75 of file avatar.h.

76  { mOriginalName = name; }

References mOriginalName.

Referenced by SocialNavigationTab::updateNames().

◆ setPoison()

void Avatar::setPoison ( const bool  b)
inline

Definition at line 183 of file avatar.h.

184  { mPoison = b; }

References mPoison.

Referenced by SocialPlayersTab::updateAvatar().

◆ setRace()

void Avatar::setRace ( const int  r)
inline

Definition at line 171 of file avatar.h.

172  { mRace = r; }

References mRace.

Referenced by EAthena::GuildRecv::processGuildMemberList().

◆ setType()

void Avatar::setType ( const int  n)
inline

Definition at line 141 of file avatar.h.

142  { mType = n; }

References mType.

Referenced by SocialNavigationTab::addPortal(), and SocialNavigationTab::updateList().

◆ setX()

void Avatar::setX ( const int  x)
inline

◆ setY()

void Avatar::setY ( const int  y)
inline

Field Documentation

◆ mCharId

int Avatar::mCharId
protected

Definition at line 188 of file avatar.h.

Referenced by getCharId(), GuildMember::GuildMember(), Guild::removeMember(), and setCharId().

◆ mDamageHp

int Avatar::mDamageHp
protected

Definition at line 193 of file avatar.h.

Referenced by getDamageHp(), and setDamageHp().

◆ mDisplayBold

bool Avatar::mDisplayBold
protected

Definition at line 204 of file avatar.h.

Referenced by getDisplayBold(), and setDisplayBold().

◆ mExp

int Avatar::mExp
protected

Definition at line 199 of file avatar.h.

Referenced by getExp(), and setExp().

◆ mGender

GenderT Avatar::mGender
protected

Definition at line 200 of file avatar.h.

Referenced by getGender(), and setGender().

◆ mHp

int Avatar::mHp
protected

Definition at line 191 of file avatar.h.

Referenced by getHp(), and setHp().

◆ mId

BeingId Avatar::mId
protected

◆ mIp

std::string Avatar::mIp
protected

Definition at line 202 of file avatar.h.

Referenced by getIp(), and setIp().

◆ mLevel

int Avatar::mLevel
protected

Definition at line 194 of file avatar.h.

Referenced by getLevel(), and setLevel().

◆ mMap

std::string Avatar::mMap
protected

Definition at line 195 of file avatar.h.

Referenced by getMap(), and setMap().

◆ mMaxHp

int Avatar::mMaxHp
protected

Definition at line 192 of file avatar.h.

Referenced by getMaxHp(), and setMaxHp().

◆ mName

std::string Avatar::mName
protected

Definition at line 189 of file avatar.h.

Referenced by getComplexName(), getName(), Guild::getName(), setName(), and Guild::setName().

◆ mOnline

bool Avatar::mOnline
protected

Definition at line 203 of file avatar.h.

Referenced by getOnline(), and setOnline().

◆ mOriginalName

std::string Avatar::mOriginalName
protected

Definition at line 190 of file avatar.h.

Referenced by getComplexName(), getOriginalName(), and setOriginalName().

◆ mPoison

bool Avatar::mPoison
protected

Definition at line 205 of file avatar.h.

Referenced by getPoison(), and setPoison().

◆ mRace

int Avatar::mRace
protected

Definition at line 201 of file avatar.h.

Referenced by getRace(), and setRace().

◆ mType

int Avatar::mType
protected

Definition at line 198 of file avatar.h.

Referenced by getType(), and setType().

◆ mX

int Avatar::mX
protected

Definition at line 196 of file avatar.h.

Referenced by getX(), and setX().

◆ mY

int Avatar::mY
protected

Definition at line 197 of file avatar.h.

Referenced by getY(), and setY().


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