GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/onlineplayer.h Lines: 0 7 0.0 %
Date: 2021-03-17 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-2019  The ManaPlus Developers
4
 *  Copyright (C) 2009-2021  Andrei Karas
5
 *
6
 *  This file is part of The ManaPlus Client.
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  any later version.
12
 *
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU General Public License for more details.
17
 *
18
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
#ifndef GUI_ONLINEPLAYER_H
23
#define GUI_ONLINEPLAYER_H
24
25
#include "enums/being/gender.h"
26
27
#include <string>
28
29
#include "localconsts.h"
30
31
class OnlinePlayer final
32
{
33
    public:
34
        OnlinePlayer(const std::string &nick,
35
                     const unsigned char status,
36
                     const signed char level,
37
                     const GenderT gender,
38
                     const signed char version,
39
                     const int group) :
40
            mNick(nick),
41
            mText(),
42
            mGroup(group),
43
            mStatus(status),
44
            mLevel(level),
45
            mVersion(version),
46
            mGender(gender),
47
            mIsGM(false)
48
        {
49
        }
50
51
        A_DELETE_COPY(OnlinePlayer)
52
53
        const std::string getNick() const noexcept2 A_WARN_UNUSED
54
        { return mNick; }
55
56
        unsigned char getStaus() const noexcept2 A_WARN_UNUSED
57
        { return mStatus; }
58
59
        void setIsGM(const bool b)
60
        { mIsGM = b; }
61
62
        char getVersion() const noexcept2 A_WARN_UNUSED
63
        { return mVersion; }
64
65
        char getLevel() const noexcept2 A_WARN_UNUSED
66
        { return mLevel; }
67
68
        const std::string getText() const noexcept2 A_WARN_UNUSED
69
        { return mText; }
70
71
        void setText(std::string str);
72
73
        void setLevel(const char level) noexcept2
74
        { mLevel = level; }
75
76
    private:
77
        std::string mNick;
78
79
        std::string mText;
80
81
        int mGroup;
82
83
        unsigned char mStatus;
84
85
        signed char mLevel;
86
87
        signed char mVersion;
88
89
        GenderT mGender;
90
91
        bool mIsGM;
92
};
93
94
#endif  // GUI_ONLINEPLAYER_H