ManaPlus
beingcacheentry.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-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 BEING_BEINGCACHEENTRY_H
23 #define BEING_BEINGCACHEENTRY_H
24 
26 
27 #include "localconsts.h"
28 
29 #include <string>
30 
32 {
33  public:
34  explicit BeingCacheEntry(const BeingId id) :
35  mName(),
36  mPartyName(),
37  mGuildName(),
38  mIp(),
39  mId(id),
40  mLevel(0),
41  mPvpRank(0),
42  mTime(0),
43  mFlags(0),
44  mTeamId(0U),
45  mIsAdvanced(false)
46  {
47  }
48 
50 
51  BeingId getId() const
52  { return mId; }
53 
57  const std::string &getName() const
58  { return mName; }
59 
65  void setName(const std::string &name)
66  { mName = name; }
67 
71  void setPartyName(const std::string &name)
72  { mPartyName = name; }
73 
74  void setGuildName(const std::string &name)
75  { mGuildName = name; }
76 
77  const std::string &getPartyName() const
78  { return mPartyName; }
79 
80  const std::string &getGuildName() const
81  { return mGuildName; }
82 
83  void setLevel(const int n)
84  { mLevel = n; }
85 
86  int getLevel() const
87  { return mLevel; }
88 
89  void setTime(const time_t n)
90  { mTime = n; }
91 
92  time_t getTime() const
93  { return mTime; }
94 
95  unsigned getPvpRank() const
96  { return mPvpRank; }
97 
98  void setPvpRank(const int r)
99  { mPvpRank = r; }
100 
101  std::string getIp() const
102  { return mIp; }
103 
104  void setIp(const std::string &ip)
105  { mIp = ip; }
106 
107  bool isAdvanced() const
108  { return mIsAdvanced; }
109 
110  void setAdvanced(const bool a)
111  { mIsAdvanced = a; }
112 
113  int getFlags() const
114  { return mFlags; }
115 
116  void setFlags(const int flags)
117  { mFlags = flags; }
118 
119  uint16_t getTeamId() const
120  { return mTeamId; }
121 
122  void setTeamId(const uint16_t teamId)
123  { mTeamId = teamId; }
124 
125  protected:
126  std::string mName;
127  std::string mPartyName;
128  std::string mGuildName;
129  std::string mIp;
131  int mLevel;
132  unsigned int mPvpRank;
133  time_t mTime;
134  int mFlags;
135  uint16_t mTeamId;
137 };
138 
139 #endif // BEING_BEINGCACHEENTRY_H
int BeingId
Definition: beingid.h:30
void setFlags(const int flags)
const std::string & getPartyName() const
std::string mGuildName
void setGuildName(const std::string &name)
std::string mName
BeingCacheEntry(const BeingId id)
BeingId getId() const
unsigned int mPvpRank
void setPartyName(const std::string &name)
bool isAdvanced() const
std::string getIp() const
int getFlags() const
void setIp(const std::string &ip)
void setLevel(const int n)
unsigned getPvpRank() const
void setTime(const time_t n)
void setAdvanced(const bool a)
const std::string & getName() const
uint16_t getTeamId() const
const std::string & getGuildName() const
time_t getTime() const
void setTeamId(const uint16_t teamId)
int getLevel() const
std::string mPartyName
void setName(const std::string &name)
void setPvpRank(const int r)
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53