ManaPlus
onlineplayer.h
Go to the documentation of this file.
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 
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 
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 
63  { return mVersion; }
64 
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 
90 
91  bool mIsGM;
92 };
93 
94 #endif // GUI_ONLINEPLAYER_H
const std::string getNick() const
Definition: onlineplayer.h:53
void setIsGM(const bool b)
Definition: onlineplayer.h:59
OnlinePlayer(const std::string &nick, const unsigned char status, const signed char level, const GenderT gender, const signed char version, const int group)
Definition: onlineplayer.h:34
std::string mText
Definition: onlineplayer.h:79
char getLevel() const
Definition: onlineplayer.h:65
void setText(std::string str)
const std::string getText() const
Definition: onlineplayer.h:68
std::string mNick
Definition: onlineplayer.h:77
unsigned char mStatus
Definition: onlineplayer.h:83
char getVersion() const
Definition: onlineplayer.h:62
signed char mLevel
Definition: onlineplayer.h:85
signed char mVersion
Definition: onlineplayer.h:87
void setLevel(const char level)
Definition: onlineplayer.h:73
unsigned char getStaus() const
Definition: onlineplayer.h:56
GenderT mGender
Definition: onlineplayer.h:89
Gender ::T GenderT
Definition: gender.h:35
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define noexcept2
Definition: localconsts.h:50
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53