ManaPlus
avatar.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2008-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef AVATAR_H
25 #define AVATAR_H
26 
27 #include "enums/being/gender.h"
28 
30 
31 #include <string>
32 
33 #include "localconsts.h"
34 
36 {
37  AVATAR_PLAYER = 0
38 };
39 
41 {
42  public:
43  explicit Avatar(const std::string &name);
44 
46 
47  virtual ~Avatar()
48  { }
49 
53  std::string getName() const noexcept2 A_WARN_UNUSED
54  { return mName; }
55 
59  void setName(const std::string &name)
60  { mName = name; }
61 
66  { return mOriginalName; }
67 
68  std::string getComplexName() const A_WARN_UNUSED;
69 
70  virtual std::string getAdditionString() const A_WARN_UNUSED;
71 
75  void setOriginalName(const std::string &name)
76  { mOriginalName = name; }
77 
82  { return mOnline; }
83 
87  void setOnline(const bool online)
88  { mOnline = online; }
89 
91  { return mHp; }
92 
93  void setHp(const int hp)
94  { mHp = hp; }
95 
97  { return mMaxHp; }
98 
99  void setMaxHp(const int maxHp)
100  { mMaxHp = maxHp; }
101 
103  { return mDamageHp; }
104 
105  void setDamageHp(const int damageHp)
106  { mDamageHp = damageHp; }
107 
109  { return mDisplayBold; }
110 
111  void setDisplayBold(const bool displayBold)
112  { mDisplayBold = displayBold; }
113 
115  { return mLevel; }
116 
117  void setLevel(const int level)
118  { mLevel = level; }
119 
120  std::string getMap() const noexcept2 A_WARN_UNUSED
121  { return mMap; }
122 
123  void setMap(const std::string &map)
124  { mMap = map; }
125 
127  { return mX; }
128 
129  void setX(const int x)
130  { mX = x; }
131 
133  { return mY; }
134 
135  void setY(const int y)
136  { mY = y; }
137 
139  { return mType; }
140 
141  void setType(const int n)
142  { mType = n; }
143 
145  { return mExp; }
146 
147  void setExp(const int n)
148  { mExp = n; }
149 
151  { return mId; }
152 
153  void setID(const BeingId id)
154  { mId = id; }
155 
157  { return mCharId; }
158 
159  void setCharId(const int id)
160  { mCharId = id; }
161 
163  { return mGender; }
164 
165  void setGender(const GenderT g)
166  { mGender = g; }
167 
169  { return mRace; }
170 
171  void setRace(const int r)
172  { mRace = r; }
173 
174  const std::string &getIp() const noexcept2 A_WARN_UNUSED
175  { return mIp; }
176 
177  void setIp(const std::string &ip)
178  { mIp = ip; }
179 
181  { return mPoison; }
182 
183  void setPoison(const bool b)
184  { mPoison = b; }
185 
186  protected:
188  int mCharId;
189  std::string mName;
190  std::string mOriginalName;
191  int mHp;
192  int mMaxHp;
194  int mLevel;
195  std::string mMap;
196  int mX;
197  int mY;
198  int mType;
199  int mExp;
201  int mRace;
202  std::string mIp;
203  bool mOnline;
205  bool mPoison;
206 };
207 
208 #endif // AVATAR_H
AvatarType
Definition: avatar.h:36
@ AVATAR_PLAYER
Definition: avatar.h:37
int BeingId
Definition: beingid.h:30
Definition: avatar.h:41
void setY(const int y)
Definition: avatar.h:135
std::string mOriginalName
Definition: avatar.h:190
void setX(const int x)
Definition: avatar.h:129
bool mOnline
Definition: avatar.h:203
bool mPoison
Definition: avatar.h:205
void setOnline(const bool online)
Definition: avatar.h:87
void setMaxHp(const int maxHp)
Definition: avatar.h:99
std::string getMap() const
Definition: avatar.h:120
virtual std::string getAdditionString() const
Definition: avatar.cpp:62
void setHp(const int hp)
Definition: avatar.h:93
void setGender(const GenderT g)
Definition: avatar.h:165
bool getOnline() const
Definition: avatar.h:81
int getCharId() const
Definition: avatar.h:156
std::string mMap
Definition: avatar.h:195
void setPoison(const bool b)
Definition: avatar.h:183
bool mDisplayBold
Definition: avatar.h:204
void setDisplayBold(const bool displayBold)
Definition: avatar.h:111
int mType
Definition: avatar.h:198
int getRace() const
Definition: avatar.h:168
int mDamageHp
Definition: avatar.h:193
int mHp
Definition: avatar.h:191
void setIp(const std::string &ip)
Definition: avatar.h:177
int getExp() const
Definition: avatar.h:144
GenderT mGender
Definition: avatar.h:200
int mX
Definition: avatar.h:196
int getY() const
Definition: avatar.h:132
void setOriginalName(const std::string &name)
Definition: avatar.h:75
int mMaxHp
Definition: avatar.h:192
std::string mName
Definition: avatar.h:189
void setType(const int n)
Definition: avatar.h:141
int mCharId
Definition: avatar.h:188
int mLevel
Definition: avatar.h:194
int getMaxHp() const
Definition: avatar.h:96
void setExp(const int n)
Definition: avatar.h:147
std::string getComplexName() const
Definition: avatar.cpp:51
bool getDisplayBold() const
Definition: avatar.h:108
int mExp
Definition: avatar.h:199
Avatar(const std::string &name)
Definition: avatar.cpp:28
int mRace
Definition: avatar.h:201
std::string mIp
Definition: avatar.h:202
void setLevel(const int level)
Definition: avatar.h:117
std::string getOriginalName() const
Definition: avatar.h:65
int getX() const
Definition: avatar.h:126
void setMap(const std::string &map)
Definition: avatar.h:123
int getType() const
Definition: avatar.h:138
GenderT getGender() const
Definition: avatar.h:162
bool getPoison() const
Definition: avatar.h:180
BeingId mId
Definition: avatar.h:187
int getDamageHp() const
Definition: avatar.h:102
BeingId getID() const
Definition: avatar.h:150
void setDamageHp(const int damageHp)
Definition: avatar.h:105
int getHp() const
Definition: avatar.h:90
void setID(const BeingId id)
Definition: avatar.h:153
std::string getName() const
Definition: avatar.h:53
const std::string & getIp() const
Definition: avatar.h:174
void setCharId(const int id)
Definition: avatar.h:159
void setRace(const int r)
Definition: avatar.h:171
int getLevel() const
Definition: avatar.h:114
void setName(const std::string &name)
Definition: avatar.h:59
int mY
Definition: avatar.h:197
Gender ::T GenderT
Definition: gender.h:35
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define notfinal
Definition: localconsts.h:261
#define noexcept2
Definition: localconsts.h:50
#define A_DELETE_COPY(func)
Definition: localconsts.h:53