diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-29 13:23:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-29 21:10:19 +0300 |
commit | 95c7914cc3c87408f482e4f5f78bcc3642ada111 (patch) | |
tree | bc99a7d17e36d49f2c743feb3e940dc4d0372e89 /src/beingcacheentry.h | |
parent | 2b13a2f1f0daafe489b5a742962970e0ecedc8f4 (diff) | |
download | manaverse-95c7914cc3c87408f482e4f5f78bcc3642ada111.tar.gz manaverse-95c7914cc3c87408f482e4f5f78bcc3642ada111.tar.bz2 manaverse-95c7914cc3c87408f482e4f5f78bcc3642ada111.tar.xz manaverse-95c7914cc3c87408f482e4f5f78bcc3642ada111.zip |
split being.cpp to some files.
Diffstat (limited to 'src/beingcacheentry.h')
-rw-r--r-- | src/beingcacheentry.h | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/src/beingcacheentry.h b/src/beingcacheentry.h new file mode 100644 index 000000000..3b5b81f5b --- /dev/null +++ b/src/beingcacheentry.h @@ -0,0 +1,126 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef BEINGCACHEENTRY_H +#define BEINGCACHEENTRY_H + +#include "localconsts.h" + +class BeingCacheEntry final +{ + public: + explicit BeingCacheEntry(const int id): + mId(id), + mName(), + mPartyName(), + mGuildName(), + mLevel(0), + mPvpRank(0), + mTime(0), + mIp(), + mIsAdvanced(false), + mFlags(0) + { + } + + A_DELETE_COPY(BeingCacheEntry) + + int getId() const + { return mId; } + + /** + * Returns the name of the being. + */ + const std::string &getName() const + { return mName; } + + /** + * Sets the name for the being. + * + * @param name The name that should appear. + */ + void setName(const std::string &name) + { mName = name; } + + /** + * Following are set from the server (mainly for players) + */ + void setPartyName(const std::string &name) + { mPartyName = name; } + + void setGuildName(const std::string &name) + { mGuildName = name; } + + const std::string &getPartyName() const + { return mPartyName; } + + const std::string &getGuildName() const + { return mGuildName; } + + void setLevel(const int n) + { mLevel = n; } + + int getLevel() const + { return mLevel; } + + void setTime(const int n) + { mTime = n; } + + int getTime() const + { return mTime; } + + unsigned getPvpRank() const + { return mPvpRank; } + + void setPvpRank(const int r) + { mPvpRank = r; } + + std::string getIp() const + { return mIp; } + + void setIp(std::string ip) + { mIp = ip; } + + bool isAdvanced() const + { return mIsAdvanced; } + + void setAdvanced(const bool a) + { mIsAdvanced = a; } + + int getFlags() const + { return mFlags; } + + void setFlags(const int flags) + { mFlags = flags; } + + protected: + int mId; /**< Unique sprite id */ + std::string mName; /**< Name of character */ + std::string mPartyName; + std::string mGuildName; + int mLevel; + unsigned int mPvpRank; + int mTime; + std::string mIp; + bool mIsAdvanced; + int mFlags; +}; + +#endif |