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