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 
29 #include "enums/simpletypes/beingid.h"
30 
31 #include <string>
32 
33 #include "localconsts.h"
34 
35 enum AvatarType
36 {
37     AVATAR_PLAYER = 0
38 };
39 
40 class Avatar notfinal
41 {
42     public:
43         explicit Avatar(const std::string &name);
44 
A_DELETE_COPY(Avatar)45         A_DELETE_COPY(Avatar)
46 
47         virtual ~Avatar()
48         { }
49 
50         /**
51          * Returns the avatar's name.
52          */
getName()53         std::string getName() const noexcept2 A_WARN_UNUSED
54         { return mName; }
55 
56         /**
57          * Set the avatar's name.
58          */
setName(const std::string & name)59         void setName(const std::string &name)
60         { mName = name; }
61 
62         /**
63          * Returns the avatar's original name.
64          */
getOriginalName()65         std::string getOriginalName() const noexcept2 A_WARN_UNUSED
66         { return mOriginalName; }
67 
68         std::string getComplexName() const A_WARN_UNUSED;
69 
70         virtual std::string getAdditionString() const A_WARN_UNUSED;
71 
72         /**
73          * Set the avatar's original name.
74          */
setOriginalName(const std::string & name)75         void setOriginalName(const std::string &name)
76         { mOriginalName = name; }
77 
78         /**
79          * Returns the avatar's online status.
80          */
getOnline()81         bool getOnline() const noexcept2 A_WARN_UNUSED
82         { return mOnline; }
83 
84         /**
85          * Set the avatar's online status.
86          */
setOnline(const bool online)87         void setOnline(const bool online)
88         { mOnline = online; }
89 
getHp()90         int getHp() const noexcept2 A_WARN_UNUSED
91         { return mHp; }
92 
setHp(const int hp)93         void setHp(const int hp)
94         { mHp = hp; }
95 
getMaxHp()96         int getMaxHp() const noexcept2 A_WARN_UNUSED
97         { return mMaxHp; }
98 
setMaxHp(const int maxHp)99         void setMaxHp(const int maxHp)
100         { mMaxHp = maxHp; }
101 
getDamageHp()102         int getDamageHp() const noexcept2 A_WARN_UNUSED
103         { return mDamageHp; }
104 
setDamageHp(const int damageHp)105         void setDamageHp(const int damageHp)
106         { mDamageHp = damageHp; }
107 
getDisplayBold()108         bool getDisplayBold() const noexcept2 A_WARN_UNUSED
109         { return mDisplayBold; }
110 
setDisplayBold(const bool displayBold)111         void setDisplayBold(const bool displayBold)
112         { mDisplayBold = displayBold; }
113 
getLevel()114         int getLevel() const noexcept2 A_WARN_UNUSED
115         { return mLevel; }
116 
setLevel(const int level)117         void setLevel(const int level)
118         { mLevel = level; }
119 
getMap()120         std::string getMap() const noexcept2 A_WARN_UNUSED
121         { return mMap; }
122 
setMap(const std::string & map)123         void setMap(const std::string &map)
124         { mMap = map; }
125 
getX()126         int getX() const noexcept2 A_WARN_UNUSED
127         { return mX; }
128 
setX(const int x)129         void setX(const int x)
130         { mX = x; }
131 
getY()132         int getY() const noexcept2 A_WARN_UNUSED
133         { return mY; }
134 
setY(const int y)135         void setY(const int y)
136         { mY = y; }
137 
getType()138         int getType() const noexcept2 A_WARN_UNUSED
139         { return mType; }
140 
setType(const int n)141         void setType(const int n)
142         { mType = n; }
143 
getExp()144         int getExp() const noexcept2 A_WARN_UNUSED
145         { return mExp; }
146 
setExp(const int n)147         void setExp(const int n)
148         { mExp = n; }
149 
getID()150         BeingId getID() const noexcept2 A_WARN_UNUSED
151         { return mId; }
152 
setID(const BeingId id)153         void setID(const BeingId id)
154         { mId = id; }
155 
getCharId()156         int getCharId() const noexcept2 A_WARN_UNUSED
157         { return mCharId; }
158 
setCharId(const int id)159         void setCharId(const int id)
160         { mCharId = id; }
161 
getGender()162         GenderT getGender() const noexcept2 A_WARN_UNUSED
163         { return mGender; }
164 
setGender(const GenderT g)165         void setGender(const GenderT g)
166         { mGender = g; }
167 
getRace()168         int getRace() const noexcept2 A_WARN_UNUSED
169         { return mRace; }
170 
setRace(const int r)171         void setRace(const int r)
172         { mRace = r; }
173 
getIp()174         const std::string &getIp() const noexcept2 A_WARN_UNUSED
175         { return mIp; }
176 
setIp(const std::string & ip)177         void setIp(const std::string &ip)
178         { mIp = ip; }
179 
getPoison()180         bool getPoison() const noexcept2 A_WARN_UNUSED
181         { return mPoison; }
182 
setPoison(const bool b)183         void setPoison(const bool b)
184         { mPoison = b; }
185 
186     protected:
187         BeingId mId;
188         int mCharId;
189         std::string mName;
190         std::string mOriginalName;
191         int mHp;
192         int mMaxHp;
193         int mDamageHp;
194         int mLevel;
195         std::string mMap;
196         int mX;
197         int mY;
198         int mType;
199         int mExp;
200         GenderT mGender;
201         int mRace;
202         std::string mIp;
203         bool mOnline;
204         bool mDisplayBold;
205         bool mPoison;
206 };
207 
208 #endif  // AVATAR_H
209