GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/avatar.h Lines: 3 37 8.1 %
Date: 2017-11-29 Branches: 0 0 0.0 %

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