diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-28 20:06:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-28 20:06:51 +0300 |
commit | 3b8a3b84346700abffa52745245310bf3eae6b18 (patch) | |
tree | dfe8c94d73da7fc3a350017f1905f3e25b5ec5e0 | |
parent | 1c1860cf83ba5d504b69c0ebd737139c8ab1bd46 (diff) | |
download | manaverse-3b8a3b84346700abffa52745245310bf3eae6b18.tar.gz manaverse-3b8a3b84346700abffa52745245310bf3eae6b18.tar.bz2 manaverse-3b8a3b84346700abffa52745245310bf3eae6b18.tar.xz manaverse-3b8a3b84346700abffa52745245310bf3eae6b18.zip |
Fix formating in other files.
-rw-r--r-- | src/avatar.h | 242 | ||||
-rw-r--r-- | src/client.h | 94 | ||||
-rw-r--r-- | src/debug/debug_new.h | 50 | ||||
-rw-r--r-- | src/debug/fast_mutex.h | 310 | ||||
-rw-r--r-- | src/effectmanager.h | 2 | ||||
-rw-r--r-- | src/guild.h | 268 | ||||
-rw-r--r-- | src/imagesprite.h | 62 | ||||
-rw-r--r-- | src/party.h | 200 | ||||
-rw-r--r-- | src/statuseffect.h | 177 |
9 files changed, 704 insertions, 701 deletions
diff --git a/src/avatar.h b/src/avatar.h index 477f6dc8c..2aa289c3e 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -36,170 +36,170 @@ enum AvatarType class Avatar notfinal { -public: - explicit Avatar(const std::string &name = ""); + public: + explicit Avatar(const std::string &name = ""); - A_DELETE_COPY(Avatar) + A_DELETE_COPY(Avatar) - virtual ~Avatar() - { } + virtual ~Avatar() + { } - /** - * Returns the avatar's name. - */ - std::string getName() const A_WARN_UNUSED - { return mName; } + /** + * Returns the avatar's name. + */ + std::string getName() const A_WARN_UNUSED + { return mName; } - /** - * Set the avatar's name. - */ - void setName(const std::string &name) - { mName = name; } + /** + * Set the avatar's name. + */ + void setName(const std::string &name) + { mName = name; } - /** - * Returns the avatar's original name. - */ - std::string getOriginalName() const A_WARN_UNUSED - { return mOriginalName; } + /** + * Returns the avatar's original name. + */ + std::string getOriginalName() const A_WARN_UNUSED + { return mOriginalName; } - std::string getComplexName() const A_WARN_UNUSED; + std::string getComplexName() const A_WARN_UNUSED; - virtual std::string getAdditionString() const A_WARN_UNUSED; + virtual std::string getAdditionString() const A_WARN_UNUSED; - /** - * Set the avatar's original name. - */ - void setOriginalName(const std::string &name) - { mOriginalName = name; } + /** + * Set the avatar's original name. + */ + void setOriginalName(const std::string &name) + { mOriginalName = name; } - /** - * Returns the avatar's online status. - */ - bool getOnline() const A_WARN_UNUSED - { return mOnline; } + /** + * Returns the avatar's online status. + */ + bool getOnline() const A_WARN_UNUSED + { return mOnline; } - /** - * Set the avatar's online status. - */ - void setOnline(const bool online) - { mOnline = online; } + /** + * Set the avatar's online status. + */ + void setOnline(const bool online) + { mOnline = online; } - int getHp() const A_WARN_UNUSED - { return mHp; } + int getHp() const A_WARN_UNUSED + { return mHp; } - void setHp(const int hp) - { mHp = hp; } + void setHp(const int hp) + { mHp = hp; } - int getMaxHp() const A_WARN_UNUSED - { return mMaxHp; } + int getMaxHp() const A_WARN_UNUSED + { return mMaxHp; } - void setMaxHp(const int maxHp) - { mMaxHp = maxHp; } + void setMaxHp(const int maxHp) + { mMaxHp = maxHp; } - int getDamageHp() const A_WARN_UNUSED - { return mDamageHp; } + int getDamageHp() const A_WARN_UNUSED + { return mDamageHp; } - void setDamageHp(const int damageHp) - { mDamageHp = damageHp; } + void setDamageHp(const int damageHp) + { mDamageHp = damageHp; } - bool getDisplayBold() const A_WARN_UNUSED - { return mDisplayBold; } + bool getDisplayBold() const A_WARN_UNUSED + { return mDisplayBold; } - void setDisplayBold(const bool displayBold) - { mDisplayBold = displayBold; } + void setDisplayBold(const bool displayBold) + { mDisplayBold = displayBold; } - int getLevel() const A_WARN_UNUSED - { return mLevel; } + int getLevel() const A_WARN_UNUSED + { return mLevel; } - void setLevel(const int level) - { mLevel = level; } + void setLevel(const int level) + { mLevel = level; } - std::string getMap() const A_WARN_UNUSED - { return mMap; } + std::string getMap() const A_WARN_UNUSED + { return mMap; } - void setMap(const std::string &map) - { mMap = map; } + void setMap(const std::string &map) + { mMap = map; } - int getX() const A_WARN_UNUSED - { return mX; } + int getX() const A_WARN_UNUSED + { return mX; } - void setX(const int x) - { mX = x; } + void setX(const int x) + { mX = x; } - int getY() const A_WARN_UNUSED - { return mY; } + int getY() const A_WARN_UNUSED + { return mY; } - void setY(const int y) - { mY = y; } + void setY(const int y) + { mY = y; } - int getType() const A_WARN_UNUSED - { return mType; } + int getType() const A_WARN_UNUSED + { return mType; } - void setType(const int n) - { mType = n; } + void setType(const int n) + { mType = n; } - int getExp() const A_WARN_UNUSED - { return mExp; } + int getExp() const A_WARN_UNUSED + { return mExp; } - void setExp(const int n) - { mExp = n; } + void setExp(const int n) + { mExp = n; } - int getID() const A_WARN_UNUSED - { return mId; } + int getID() const A_WARN_UNUSED + { return mId; } - void setID(const int id) - { mId = id; } + void setID(const int id) + { mId = id; } - int getCharId() const A_WARN_UNUSED - { return mCharId; } + int getCharId() const A_WARN_UNUSED + { return mCharId; } - void setCharId(const int id) - { mCharId = id; } + void setCharId(const int id) + { mCharId = id; } - Gender::Type getGender() const A_WARN_UNUSED - { return mGender; } + Gender::Type getGender() const A_WARN_UNUSED + { return mGender; } - void setGender(const Gender::Type g) - { mGender = g; } + void setGender(const Gender::Type g) + { mGender = g; } - int getRace() const A_WARN_UNUSED - { return mRace; } + int getRace() const A_WARN_UNUSED + { return mRace; } - void setRace(const int r) - { mRace = r; } + void setRace(const int r) + { mRace = r; } - const std::string &getIp() const A_WARN_UNUSED - { return mIp; } + const std::string &getIp() const A_WARN_UNUSED + { return mIp; } - void setIp(const std::string &ip) - { mIp = ip; } + void setIp(const std::string &ip) + { mIp = ip; } - bool getPoison() const A_WARN_UNUSED - { return mPoison; } + bool getPoison() const A_WARN_UNUSED + { return mPoison; } - void setPoison(const bool b) - { mPoison = b; } + void setPoison(const bool b) + { mPoison = b; } -protected: - int mId; - int mCharId; - std::string mName; - std::string mOriginalName; - int mHp; - int mMaxHp; - int mDamageHp; - int mLevel; - std::string mMap; - int mX; - int mY; - int mType; - int mExp; - Gender::Type mGender; - int mRace; - std::string mIp; - bool mOnline; - bool mDisplayBold; - bool mPoison; + protected: + int mId; + int mCharId; + std::string mName; + std::string mOriginalName; + int mHp; + int mMaxHp; + int mDamageHp; + int mLevel; + std::string mMap; + int mX; + int mY; + int mType; + int mExp; + Gender::Type mGender; + int mRace; + std::string mIp; + bool mOnline; + bool mDisplayBold; + bool mPoison; }; #endif // AVATAR_H diff --git a/src/client.h b/src/client.h index 6dff50877..23bc7c0b2 100644 --- a/src/client.h +++ b/src/client.h @@ -68,86 +68,86 @@ extern LoginData loginData; class Client final : public ConfigListener, public ActionListener { -public: - Client(); + public: + Client(); - A_DELETE_COPY(Client) + A_DELETE_COPY(Client) - ~Client(); + ~Client(); - void gameInit(); + void gameInit(); - void testsInit(); + void testsInit(); - int gameExec(); + int gameExec(); - static int testsExec(); + static int testsExec(); - void setState(const State state) - { mState = state; } + void setState(const State state) + { mState = state; } - State getState() const A_WARN_UNUSED - { return mState; } + State getState() const A_WARN_UNUSED + { return mState; } - static bool isTmw() A_WARN_UNUSED; + static bool isTmw() A_WARN_UNUSED; - void optionChanged(const std::string &name) override final; + void optionChanged(const std::string &name) override final; - void action(const ActionEvent &event) override final; + void action(const ActionEvent &event) override final; - static void initTradeFilter(); + static void initTradeFilter(); - void moveButtons(const int width); + void moveButtons(const int width); - void windowRemoved(const Window *const window); + void windowRemoved(const Window *const window); - static void setEnv(const char *const name, const char *const value); + static void setEnv(const char *const name, const char *const value); -private: - void initSoundManager(); + private: + void initSoundManager(); - void initConfigListeners(); + void initConfigListeners(); - static void initGraphics(); + static void initGraphics(); - static void updateEnv(); + static void updateEnv(); - static void initFeatures(); + static void initFeatures(); - void gameClear(); + void gameClear(); - void testsClear(); + void testsClear(); - static void logVars(); + static void logVars(); #ifdef ANDROID #ifdef USE_SDL2 - static void extractAssets(); + static void extractAssets(); #endif #endif - ServerInfo mCurrentServer; - - Game *mGame; - Window *mCurrentDialog; - QuitDialog *mQuitDialog; - Button *mSetupButton; - Button *mVideoButton; - Button *mHelpButton; - Button *mAboutButton; - Button *mThemesButton; - Button *mPerfomanceButton; + ServerInfo mCurrentServer; + + Game *mGame; + Window *mCurrentDialog; + QuitDialog *mQuitDialog; + Button *mSetupButton; + Button *mVideoButton; + Button *mHelpButton; + Button *mAboutButton; + Button *mThemesButton; + Button *mPerfomanceButton; #ifdef ANDROID - Button *mCloseButton; + Button *mCloseButton; #endif - State mState; - State mOldState; + State mState; + State mOldState; - Skin *mSkin; - int mButtonPadding; - int mButtonSpacing; - bool mConfigAutoSaved; + Skin *mSkin; + int mButtonPadding; + int mButtonSpacing; + bool mConfigAutoSaved; }; extern Client *client; diff --git a/src/debug/debug_new.h b/src/debug/debug_new.h index 39f2f59d1..d29a0d4f3 100644 --- a/src/debug/debug_new.h +++ b/src/debug/debug_new.h @@ -142,27 +142,27 @@ extern const char* new_progname; // default to NULL; should be */ class __debug_new_recorder { - const char* _M_file; - const int _M_line; - void _M_process(void* pointer); -public: - /** - * Constructor to remember the call context. The information will - * be used in __debug_new_recorder::operator->*. - */ - __debug_new_recorder(const char* file, int line) - : _M_file(file), _M_line(line) {} - /** - * Operator to write the context information to memory. - * <code>operator->*</code> is chosen because it has the right - * precedence, it is rarely used, and it looks good: so people can - * tell the special usage more quickly. - */ - template <class _Tp> _Tp* operator->*(_Tp* pointer) - { _M_process(pointer); return pointer; } -private: - __debug_new_recorder(const __debug_new_recorder&); - __debug_new_recorder& operator=(const __debug_new_recorder&); + const char* _M_file; + const int _M_line; + void _M_process(void* pointer); + public: + /** + * Constructor to remember the call context. The information will + * be used in __debug_new_recorder::operator->*. + */ + __debug_new_recorder(const char* file, int line) + : _M_file(file), _M_line(line) {} + /** + * Operator to write the context information to memory. + * <code>operator->*</code> is chosen because it has the right + * precedence, it is rarely used, and it looks good: so people can + * tell the special usage more quickly. + */ + template <class _Tp> _Tp* operator->*(_Tp* pointer) + { _M_process(pointer); return pointer; } + private: + __debug_new_recorder(const __debug_new_recorder&); + __debug_new_recorder& operator=(const __debug_new_recorder&); }; /** @@ -173,10 +173,10 @@ private: */ class __debug_new_counter { - static int _S_count; -public: - __debug_new_counter(); - ~__debug_new_counter(); + static int _S_count; + public: + __debug_new_counter(); + ~__debug_new_counter(); }; /** Counting object for each file including debug_new.h. */ static __debug_new_counter __debug_new_count; diff --git a/src/debug/fast_mutex.h b/src/debug/fast_mutex.h index 5c6471fae..8bedd3aeb 100644 --- a/src/debug/fast_mutex.h +++ b/src/debug/fast_mutex.h @@ -118,64 +118,64 @@ */ class fast_mutex { - pthread_mutex_t _M_mtx_impl; -# if _FAST_MUTEX_CHECK_INITIALIZATION - bool _M_initialized; -# endif -# ifdef _DEBUG - bool _M_locked; -# endif - public: - fast_mutex() -# ifdef _DEBUG - : _M_locked(false) -# endif - { - ::pthread_mutex_init(&_M_mtx_impl, nullptr); -# if _FAST_MUTEX_CHECK_INITIALIZATION - _M_initialized = true; -# endif - } - ~fast_mutex() - { - _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); -# if _FAST_MUTEX_CHECK_INITIALIZATION - _M_initialized = false; -# endif - ::pthread_mutex_destroy(&_M_mtx_impl); - } - void lock() - { -# if _FAST_MUTEX_CHECK_INITIALIZATION - if (!_M_initialized) - return; -# endif - ::pthread_mutex_lock(&_M_mtx_impl); -# ifdef _DEBUG - // The following assertion should _always_ be true for a - // real `fast' pthread_mutex. However, this assertion can - // help sometimes, when people forget to use `-lpthread' and - // glibc provides an empty implementation. Having this - // assertion is also more consistent. - _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); - _M_locked = true; -# endif - } - void unlock() - { -# if _FAST_MUTEX_CHECK_INITIALIZATION - if (!_M_initialized) - return; -# endif -# ifdef _DEBUG - _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); - _M_locked = false; -# endif - ::pthread_mutex_unlock(&_M_mtx_impl); - } - private: - fast_mutex(const fast_mutex&); - fast_mutex& operator=(const fast_mutex&); + pthread_mutex_t _M_mtx_impl; +# if _FAST_MUTEX_CHECK_INITIALIZATION + bool _M_initialized; +# endif +# ifdef _DEBUG + bool _M_locked; +# endif + public: + fast_mutex() +# ifdef _DEBUG + : _M_locked(false) +# endif + { + ::pthread_mutex_init(&_M_mtx_impl, nullptr); +# if _FAST_MUTEX_CHECK_INITIALIZATION + _M_initialized = true; +# endif + } + ~fast_mutex() + { + _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); +# if _FAST_MUTEX_CHECK_INITIALIZATION + _M_initialized = false; +# endif + ::pthread_mutex_destroy(&_M_mtx_impl); + } + void lock() + { +# if _FAST_MUTEX_CHECK_INITIALIZATION + if (!_M_initialized) + return; +# endif + ::pthread_mutex_lock(&_M_mtx_impl); +# ifdef _DEBUG + // The following assertion should _always_ be true for a + // real `fast' pthread_mutex. However, this assertion can + // help sometimes, when people forget to use `-lpthread' and + // glibc provides an empty implementation. Having this + // assertion is also more consistent. + _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); + _M_locked = true; +# endif + } + void unlock() + { +# if _FAST_MUTEX_CHECK_INITIALIZATION + if (!_M_initialized) + return; +# endif +# ifdef _DEBUG + _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); + _M_locked = false; +# endif + ::pthread_mutex_unlock(&_M_mtx_impl); + } + private: + fast_mutex(const fast_mutex&); + fast_mutex& operator=(const fast_mutex&); }; # endif // _PTHREADS @@ -192,59 +192,59 @@ */ class fast_mutex { - CRITICAL_SECTION _M_mtx_impl; -# if _FAST_MUTEX_CHECK_INITIALIZATION - bool _M_initialized; -# endif -# ifdef _DEBUG - bool _M_locked; -# endif - public: - fast_mutex() -# ifdef _DEBUG - : _M_locked(false) -# endif - { - ::InitializeCriticalSection(&_M_mtx_impl); -# if _FAST_MUTEX_CHECK_INITIALIZATION - _M_initialized = true; -# endif - } - ~fast_mutex() - { - _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); -# if _FAST_MUTEX_CHECK_INITIALIZATION - _M_initialized = false; -# endif - ::DeleteCriticalSection(&_M_mtx_impl); - } - void lock() - { -# if _FAST_MUTEX_CHECK_INITIALIZATION - if (!_M_initialized) - return; -# endif - ::EnterCriticalSection(&_M_mtx_impl); -# ifdef _DEBUG - _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); - _M_locked = true; -# endif - } - void unlock() - { -# if _FAST_MUTEX_CHECK_INITIALIZATION - if (!_M_initialized) - return; -# endif -# ifdef _DEBUG - _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); - _M_locked = false; -# endif - ::LeaveCriticalSection(&_M_mtx_impl); - } - private: - fast_mutex(const fast_mutex&); - fast_mutex& operator=(const fast_mutex&); + CRITICAL_SECTION _M_mtx_impl; +# if _FAST_MUTEX_CHECK_INITIALIZATION + bool _M_initialized; +# endif +# ifdef _DEBUG + bool _M_locked; +# endif + public: + fast_mutex() +# ifdef _DEBUG + : _M_locked(false) +# endif + { + ::InitializeCriticalSection(&_M_mtx_impl); +# if _FAST_MUTEX_CHECK_INITIALIZATION + _M_initialized = true; +# endif + } + ~fast_mutex() + { + _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); +# if _FAST_MUTEX_CHECK_INITIALIZATION + _M_initialized = false; +# endif + ::DeleteCriticalSection(&_M_mtx_impl); + } + void lock() + { +# if _FAST_MUTEX_CHECK_INITIALIZATION + if (!_M_initialized) + return; +# endif + ::EnterCriticalSection(&_M_mtx_impl); +# ifdef _DEBUG + _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); + _M_locked = true; +# endif + } + void unlock() + { +# if _FAST_MUTEX_CHECK_INITIALIZATION + if (!_M_initialized) + return; +# endif +# ifdef _DEBUG + _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); + _M_locked = false; +# endif + ::LeaveCriticalSection(&_M_mtx_impl); + } + private: + fast_mutex(const fast_mutex&); + fast_mutex& operator=(const fast_mutex&); }; # endif // _WIN32THREADS @@ -260,56 +260,56 @@ */ class fast_mutex { -# ifdef _DEBUG - bool _M_locked; -# endif - public: - fast_mutex() -# ifdef _DEBUG - : _M_locked(false) -# endif - { - } - ~fast_mutex() - { - _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); - } - void lock() - { -# ifdef _DEBUG - _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); - _M_locked = true; -# endif - } - void unlock() - { -# ifdef _DEBUG - _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); - _M_locked = false; -# endif - } - private: - fast_mutex(const fast_mutex&); - fast_mutex& operator=(const fast_mutex&); +# ifdef _DEBUG + bool _M_locked; +# endif + public: + fast_mutex() +# ifdef _DEBUG + : _M_locked(false) +# endif + { + } + ~fast_mutex() + { + _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked"); + } + void lock() + { +# ifdef _DEBUG + _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked"); + _M_locked = true; +# endif + } + void unlock() + { +# ifdef _DEBUG + _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked"); + _M_locked = false; +# endif + } + private: + fast_mutex(const fast_mutex&); + fast_mutex& operator=(const fast_mutex&); }; # endif // _NOTHREADS /** An acquistion-on-initialization lock class based on fast_mutex. */ class fast_mutex_autolock { - fast_mutex& _M_mtx; -public: - explicit fast_mutex_autolock(fast_mutex& __mtx) : _M_mtx(__mtx) - { - _M_mtx.lock(); - } - ~fast_mutex_autolock() - { - _M_mtx.unlock(); - } -private: - fast_mutex_autolock(const fast_mutex_autolock&); - fast_mutex_autolock& operator=(const fast_mutex_autolock&); + fast_mutex& _M_mtx; + public: + explicit fast_mutex_autolock(fast_mutex& __mtx) : _M_mtx(__mtx) + { + _M_mtx.lock(); + } + ~fast_mutex_autolock() + { + _M_mtx.unlock(); + } + private: + fast_mutex_autolock(const fast_mutex_autolock&); + fast_mutex_autolock& operator=(const fast_mutex_autolock&); }; #endif // M_FAST_MUTEX_H diff --git a/src/effectmanager.h b/src/effectmanager.h index dd90ddbec..9146a002d 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -60,7 +60,7 @@ class EffectManager final bool trigger(const int id, const int x, const int y, const int rotation = 0); - private: + private: std::vector<EffectDescription> mEffects; }; diff --git a/src/guild.h b/src/guild.h index 6206271e0..08b8b936e 100644 --- a/src/guild.h +++ b/src/guild.h @@ -38,184 +38,184 @@ typedef std::map<unsigned, std::string> PositionsMap; class GuildMember final : public Avatar { -public: - A_DELETE_COPY(GuildMember) + public: + A_DELETE_COPY(GuildMember) - const Guild *getGuild() const A_WARN_UNUSED - { return mGuild; } + const Guild *getGuild() const A_WARN_UNUSED + { return mGuild; } - int getPos() const A_WARN_UNUSED - { return mPos; } + int getPos() const A_WARN_UNUSED + { return mPos; } - void setPos(const int pos) - { mPos = pos; } + void setPos(const int pos) + { mPos = pos; } - std::string getAdditionString() const override final A_WARN_UNUSED; + std::string getAdditionString() const override final A_WARN_UNUSED; -protected: - friend class Guild; + protected: + friend class Guild; - GuildMember(Guild *const guild, const int id, const int accountId, - const std::string &name); + GuildMember(Guild *const guild, const int id, const int accountId, + const std::string &name); - GuildMember(Guild *const guild, const std::string &name); + GuildMember(Guild *const guild, const std::string &name); - Guild *mGuild; - int mPos; + Guild *mGuild; + int mPos; }; class Guild final : public AvatarListModel { -public: - A_DELETE_COPY(Guild) - - ~Guild(); - - /** - * Set the guild's name. - */ - void setName(const std::string &name) - { mName = name; } - - /** - * Adds member to the list. - */ - GuildMember *addMember(const int accountId, const int charId, - const std::string &name); - - /** - * Adds member to the list. - */ - GuildMember *addMember(const std::string &name); + public: + A_DELETE_COPY(Guild) + + ~Guild(); + + /** + * Set the guild's name. + */ + void setName(const std::string &name) + { mName = name; } + + /** + * Adds member to the list. + */ + GuildMember *addMember(const int accountId, const int charId, + const std::string &name); + + /** + * Adds member to the list. + */ + GuildMember *addMember(const std::string &name); - /** - * Find a member by ID. - * - * @return the member with the given ID, or NULL if they don't exist. - */ - GuildMember *getMember(const int id) const; + /** + * Find a member by ID. + * + * @return the member with the given ID, or NULL if they don't exist. + */ + GuildMember *getMember(const int id) const; - /** - * Find a member by account ID and char ID. - * - * @return the member with the given ID, or NULL if they don't exist. - */ - GuildMember *getMember(const int accountId, const int charId) - const A_WARN_UNUSED; + /** + * Find a member by account ID and char ID. + * + * @return the member with the given ID, or NULL if they don't exist. + */ + GuildMember *getMember(const int accountId, const int charId) + const A_WARN_UNUSED; - /** - * Find a member by name. - * - * @return the member with the given name, or NULL if they don't exist. - */ - GuildMember *getMember(const std::string &name) const A_WARN_UNUSED; + /** + * Find a member by name. + * + * @return the member with the given name, or NULL if they don't exist. + */ + GuildMember *getMember(const std::string &name) const A_WARN_UNUSED; - /** - * Get the name of the guild. - * @return returns name of the guild - */ - const std::string &getName() const A_WARN_UNUSED - { return mName; } + /** + * Get the name of the guild. + * @return returns name of the guild + */ + const std::string &getName() const A_WARN_UNUSED + { return mName; } - /** - * Get the id of the guild. - * @return Returns the id of the guild - */ - int16_t getId() const A_WARN_UNUSED - { return mId; } + /** + * Get the id of the guild. + * @return Returns the id of the guild + */ + int16_t getId() const A_WARN_UNUSED + { return mId; } - /** - * Removes a member from the guild. - */ - void removeMember(const GuildMember *const member); + /** + * Removes a member from the guild. + */ + void removeMember(const GuildMember *const member); - /** - * Removes a member from the guild. - */ - void removeMember(const int id); + /** + * Removes a member from the guild. + */ + void removeMember(const int id); - /** - * Removes a member from the guild. - */ - void removeMember(const std::string &name); + /** + * Removes a member from the guild. + */ + void removeMember(const std::string &name); - void removeFromMembers(); + void removeFromMembers(); - void clearMembers() - { delete_all(mMembers); mMembers.clear(); } + void clearMembers() + { delete_all(mMembers); mMembers.clear(); } - /** - * Get size of members list. - * @return Returns the number of members in the guild. - */ - int getNumberOfElements() override final A_WARN_UNUSED - { return static_cast<int>(mMembers.size()); } + /** + * Get size of members list. + * @return Returns the number of members in the guild. + */ + int getNumberOfElements() override final A_WARN_UNUSED + { return static_cast<int>(mMembers.size()); } - Avatar *getAvatarAt(const int i) override final A_WARN_UNUSED; + Avatar *getAvatarAt(const int i) override final A_WARN_UNUSED; - /** - * Get whether user can invite users to this guild. - * @return Returns true if user can invite users - */ - bool getInviteRights() const A_WARN_UNUSED - { return mCanInviteUsers; } + /** + * Get whether user can invite users to this guild. + * @return Returns true if user can invite users + */ + bool getInviteRights() const A_WARN_UNUSED + { return mCanInviteUsers; } - void setRights(const int16_t rights); + void setRights(const int16_t rights); - bool isMember(const GuildMember *const member) const A_WARN_UNUSED; + bool isMember(const GuildMember *const member) const A_WARN_UNUSED; - bool isMember(const int id) const A_WARN_UNUSED; + bool isMember(const int id) const A_WARN_UNUSED; - bool isMember(const std::string &name) const A_WARN_UNUSED; + bool isMember(const std::string &name) const A_WARN_UNUSED; - void getNames(StringVect &names) const; + void getNames(StringVect &names) const; - void addPos(const int id, const std::string &name); - - void sort(); + void addPos(const int id, const std::string &name); + + void sort(); - std::string getPos(const int id) const A_WARN_UNUSED; + std::string getPos(const int id) const A_WARN_UNUSED; - static Guild *getGuild(const int16_t id) A_WARN_UNUSED; + static Guild *getGuild(const int16_t id) A_WARN_UNUSED; - const PositionsMap &getPositions() const A_WARN_UNUSED - { return mPositions; } + const PositionsMap &getPositions() const A_WARN_UNUSED + { return mPositions; } - void setEmblemId(const int id) - { mEmblemId = id; } + void setEmblemId(const int id) + { mEmblemId = id; } - int getEmblemId() const A_WARN_UNUSED - { return mEmblemId; } + int getEmblemId() const A_WARN_UNUSED + { return mEmblemId; } - static void clearGuilds(); + static void clearGuilds(); - void setServerGuild(const bool b) - { mServerGuild = b; } + void setServerGuild(const bool b) + { mServerGuild = b; } - bool getServerGuild() const A_WARN_UNUSED - { return mServerGuild; } + bool getServerGuild() const A_WARN_UNUSED + { return mServerGuild; } - typedef std::vector<GuildMember*> MemberList; + typedef std::vector<GuildMember*> MemberList; - const MemberList *getMembers() const A_WARN_UNUSED - { return &mMembers; } + const MemberList *getMembers() const A_WARN_UNUSED + { return &mMembers; } -private: - typedef std::map<int, Guild*> GuildMap; - static GuildMap guilds; + private: + typedef std::map<int, Guild*> GuildMap; + static GuildMap guilds; - /** - * Constructor with guild id passed to it. - */ - explicit Guild(const int16_t id); + /** + * Constructor with guild id passed to it. + */ + explicit Guild(const int16_t id); - MemberList mMembers; - std::string mName; - int16_t mId; - bool mCanInviteUsers; - int mEmblemId; - PositionsMap mPositions; - bool mServerGuild; + MemberList mMembers; + std::string mName; + int16_t mId; + bool mCanInviteUsers; + int mEmblemId; + PositionsMap mPositions; + bool mServerGuild; }; #endif // GUILD_H diff --git a/src/imagesprite.h b/src/imagesprite.h index 7d936b7f7..929d72a5e 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -30,52 +30,52 @@ class Graphics; class ImageSprite final : public Sprite { -public: - explicit ImageSprite(Image *const image); + public: + explicit ImageSprite(Image *const image); - A_DELETE_COPY(ImageSprite) + A_DELETE_COPY(ImageSprite) - ~ImageSprite(); + ~ImageSprite(); - bool reset() override final - { return false; } + bool reset() override final + { return false; } - bool play(const std::string &action A_UNUSED) override final - { return false; } + bool play(const std::string &action A_UNUSED) override final + { return false; } - bool update(const int time A_UNUSED) override final - { return false; } + bool update(const int time A_UNUSED) override final + { return false; } - void draw(Graphics *const graphics, - const int posX, const int posY) const override final; + void draw(Graphics *const graphics, + const int posX, const int posY) const override final; - int getWidth() const override final A_WARN_UNUSED - { return mImage ? mImage->getWidth() : 0; } + int getWidth() const override final A_WARN_UNUSED + { return mImage ? mImage->getWidth() : 0; } - int getHeight() const override final A_WARN_UNUSED - { return mImage ? mImage->getHeight() : 0; } + int getHeight() const override final A_WARN_UNUSED + { return mImage ? mImage->getHeight() : 0; } - const Image* getImage() const A_WARN_UNUSED - { return mImage; } + const Image* getImage() const A_WARN_UNUSED + { return mImage; } - bool setSpriteDirection(const SpriteDirection::Type - direction A_UNUSED) override final - { return false; } + bool setSpriteDirection(const SpriteDirection::Type + direction A_UNUSED) override final + { return false; } - int getNumberOfLayers() const A_WARN_UNUSED - { return 1; } + int getNumberOfLayers() const A_WARN_UNUSED + { return 1; } - unsigned int getCurrentFrame() const override final A_WARN_UNUSED - { return 0; } + unsigned int getCurrentFrame() const override final A_WARN_UNUSED + { return 0; } - unsigned int getFrameCount() const override final A_WARN_UNUSED - { return 1; } + unsigned int getFrameCount() const override final A_WARN_UNUSED + { return 1; } - bool updateNumber(const unsigned num A_UNUSED) override final - { return false; } + bool updateNumber(const unsigned num A_UNUSED) override final + { return false; } -private: - Image *mImage; + private: + Image *mImage; }; #endif // IMAGESPRITE_H diff --git a/src/party.h b/src/party.h index c839168c7..a5f0ea76f 100644 --- a/src/party.h +++ b/src/party.h @@ -34,145 +34,145 @@ class Party; class PartyMember final : public Avatar { -public: - A_DELETE_COPY(PartyMember) + public: + A_DELETE_COPY(PartyMember) - const Party *getParty() const A_WARN_UNUSED - { return mParty; } + const Party *getParty() const A_WARN_UNUSED + { return mParty; } - bool getLeader() const A_WARN_UNUSED - { return mLeader; } + bool getLeader() const A_WARN_UNUSED + { return mLeader; } - void setLeader(const bool leader) - { mLeader = leader; setDisplayBold(leader); } + void setLeader(const bool leader) + { mLeader = leader; setDisplayBold(leader); } -protected: - friend class Party; + protected: + friend class Party; - PartyMember(Party *const party, const int id, const std::string &name); + PartyMember(Party *const party, const int id, const std::string &name); - Party *mParty; - bool mLeader; + Party *mParty; + bool mLeader; }; class Party final : public AvatarListModel { -public: - A_DELETE_COPY(Party) + public: + A_DELETE_COPY(Party) - /** - * Set the party's name. - */ - void setName(const std::string &name) - { mName = name; } + /** + * Set the party's name. + */ + void setName(const std::string &name) + { mName = name; } - /** - * Adds member to the list. - */ - PartyMember *addMember(const int id, const std::string &name); + /** + * Adds member to the list. + */ + PartyMember *addMember(const int id, const std::string &name); - /** - * Find a member by ID. - * - * @return the member with the given ID, or NULL if they don't exist. - */ - PartyMember *getMember(const int id) const A_WARN_UNUSED; + /** + * Find a member by ID. + * + * @return the member with the given ID, or NULL if they don't exist. + */ + PartyMember *getMember(const int id) const A_WARN_UNUSED; - /** - * Find a member by name. - * - * @return the member with the given name, or NULL if they don't exist. - */ - PartyMember *getMember(const std::string &name) const A_WARN_UNUSED; + /** + * Find a member by name. + * + * @return the member with the given name, or NULL if they don't exist. + */ + PartyMember *getMember(const std::string &name) const A_WARN_UNUSED; - /** - * Get the name of the party. - * @return returns name of the party - */ - const std::string &getName() const A_WARN_UNUSED - { return mName; } + /** + * Get the name of the party. + * @return returns name of the party + */ + const std::string &getName() const A_WARN_UNUSED + { return mName; } - /** - * Get the id of the party. - * @return Returns the id of the party - */ - int16_t getId() const A_WARN_UNUSED - { return mId; } + /** + * Get the id of the party. + * @return Returns the id of the party + */ + int16_t getId() const A_WARN_UNUSED + { return mId; } - /** - * Removes a member from the party. - */ - void removeMember(const PartyMember *const member); + /** + * Removes a member from the party. + */ + void removeMember(const PartyMember *const member); - /** - * Removes a member from the party. - */ - void removeMember(const int id); + /** + * Removes a member from the party. + */ + void removeMember(const int id); - /** - * Removes a member from the party. - */ - void removeMember(const std::string &name); + /** + * Removes a member from the party. + */ + void removeMember(const std::string &name); - void clearMembers() - { delete_all(mMembers); mMembers.clear(); } + void clearMembers() + { delete_all(mMembers); mMembers.clear(); } - void removeFromMembers(); + void removeFromMembers(); - /** - * Get size of members list. - * @return Returns the number of members in the party. - */ - int getNumberOfElements() override final A_WARN_UNUSED - { return static_cast<int>(mMembers.size()); } + /** + * Get size of members list. + * @return Returns the number of members in the party. + */ + int getNumberOfElements() override final A_WARN_UNUSED + { return static_cast<int>(mMembers.size()); } - Avatar *getAvatarAt(const int i) override final; + Avatar *getAvatarAt(const int i) override final; - /** - * Get whether user can invite users to this party. - * @return Returns true if user can invite users - */ - bool getInviteRights() const A_WARN_UNUSED - { return mCanInviteUsers; } + /** + * Get whether user can invite users to this party. + * @return Returns true if user can invite users + */ + bool getInviteRights() const A_WARN_UNUSED + { return mCanInviteUsers; } - void setRights(const int16_t rights); + void setRights(const int16_t rights); - bool isMember(const PartyMember *const member) const A_WARN_UNUSED; + bool isMember(const PartyMember *const member) const A_WARN_UNUSED; - bool isMember(const int id) const A_WARN_UNUSED; + bool isMember(const int id) const A_WARN_UNUSED; - bool isMember(const std::string &name) const A_WARN_UNUSED; + bool isMember(const std::string &name) const A_WARN_UNUSED; - void getNames(StringVect &names) const; + void getNames(StringVect &names) const; - void getNamesSet(std::set<std::string> &names) const; + void getNamesSet(std::set<std::string> &names) const; - void sort(); + void sort(); - typedef std::vector<PartyMember*> MemberList; + typedef std::vector<PartyMember*> MemberList; - const MemberList *getMembers() const A_WARN_UNUSED - { return &mMembers; } + const MemberList *getMembers() const A_WARN_UNUSED + { return &mMembers; } - static Party *getParty(const int16_t id) A_WARN_UNUSED; + static Party *getParty(const int16_t id) A_WARN_UNUSED; - static void clearParties(); + static void clearParties(); -private: - typedef std::map<int, Party*> PartyMap; - static PartyMap parties; + private: + typedef std::map<int, Party*> PartyMap; + static PartyMap parties; - /** - * Constructor with party id passed to it. - */ - explicit Party(const int16_t id); + /** + * Constructor with party id passed to it. + */ + explicit Party(const int16_t id); - ~Party(); + ~Party(); - MemberList mMembers; - std::string mName; - int16_t mId; - bool mCanInviteUsers; + MemberList mMembers; + std::string mName; + int16_t mId; + bool mCanInviteUsers; }; #endif // PARTY_H diff --git a/src/statuseffect.h b/src/statuseffect.h index e30d9d1bd..e867a9efa 100644 --- a/src/statuseffect.h +++ b/src/statuseffect.h @@ -32,95 +32,98 @@ class Particle; class StatusEffect final { -public: - StatusEffect(); - - A_DELETE_COPY(StatusEffect) - - ~StatusEffect(); - - /** - * Plays the sound effect associated with this status effect, if possible. - */ - void playSFX() const; - - /** - * Delivers the chat message associated with this status effect, if - * possible. - */ - void deliverMessage() const; - - /** - * Creates the particle effect associated with this status effect, if - * possible. - */ - Particle *getParticle() const A_WARN_UNUSED; - - /** - * Retrieves the status icon for this effect, if applicable - */ - AnimatedSprite *getIcon() const A_WARN_UNUSED; - - /** - * Retrieves an action to perform, or SpriteAction::INVALID - */ - std::string getAction() const A_WARN_UNUSED; - - /** - * Determines whether the particle effect should be restarted when the - * being changes maps - */ - bool particleEffectIsPersistent() const A_WARN_UNUSED - { return mPersistentParticleEffect; } - - bool isPoison() const A_WARN_UNUSED - { return mIsPoison; } - - /** - * Retrieves a status effect. - * - * \param index Index of the status effect. - * \param enabling Whether to retrieve the activating effect (true) or - * the deactivating effect (false). - */ - static StatusEffect *getStatusEffect(const int index, - const bool enabling) A_WARN_UNUSED; - - /** - * Retrieves a stun effect. - * - * \param index Index of the stun effect. - * \param enabling Whether to retrieve the activating effect (true) or - * the deactivating effect (false). - */ - static StatusEffect *getStunEffect(const int index, - const bool enabling) A_WARN_UNUSED; - - /** - * Maps a block effect index to its corresponding effect index. Block - * effect indices are used for opt2/opt3/status.option blocks; their - * mapping to regular effect indices is handled in the config file. - * - * Returns -1 on failure. - */ - static int blockEffectIndexToEffectIndex(const int blocKIndex) + public: + StatusEffect(); + + A_DELETE_COPY(StatusEffect) + + ~StatusEffect(); + + /** + * Plays the sound effect associated with this status effect, if + * possible. + */ + void playSFX() const; + + /** + * Delivers the chat message associated with this status effect, if + * possible. + */ + void deliverMessage() const; + + /** + * Creates the particle effect associated with this status effect, if + * possible. + */ + Particle *getParticle() const A_WARN_UNUSED; + + /** + * Retrieves the status icon for this effect, if applicable + */ + AnimatedSprite *getIcon() const A_WARN_UNUSED; + + /** + * Retrieves an action to perform, or SpriteAction::INVALID + */ + std::string getAction() const A_WARN_UNUSED; + + /** + * Determines whether the particle effect should be restarted when the + * being changes maps + */ + bool particleEffectIsPersistent() const A_WARN_UNUSED + { return mPersistentParticleEffect; } + + bool isPoison() const A_WARN_UNUSED + { return mIsPoison; } + + /** + * Retrieves a status effect. + * + * \param index Index of the status effect. + * \param enabling Whether to retrieve the activating effect (true) or + * the deactivating effect (false). + */ + static StatusEffect *getStatusEffect(const int index, + const bool enabling) A_WARN_UNUSED; - static void load(); - - static void loadXmlFile(const std::string &fileName); - - static void unload(); -private: - static bool mLoaded; - - std::string mMessage; - std::string mSFXEffect; - std::string mParticleEffect; - std::string mIcon; - std::string mAction; - bool mPersistentParticleEffect; - bool mIsPoison; + /** + * Retrieves a stun effect. + * + * \param index Index of the stun effect. + * \param enabling Whether to retrieve the activating effect (true) or + * the deactivating effect (false). + */ + static StatusEffect *getStunEffect(const int index, + const bool enabling) A_WARN_UNUSED; + + /** + * Maps a block effect index to its corresponding effect index. Block + * effect indices are used for opt2/opt3/status.option blocks; their + * mapping to regular effect indices is handled in the config file. + * + * Returns -1 on failure. + */ + static int blockEffectIndexToEffectIndex(const int blocKIndex) + A_WARN_UNUSED; + + static void load(); + + static void loadXmlFile(const std::string &fileName); + + static void unload(); + + private: + static bool mLoaded; + + std::string mMessage; + std::string mSFXEffect; + std::string mParticleEffect; + std::string mIcon; + std::string mAction; + bool mPersistentParticleEffect; + bool mIsPoison; }; #endif // STATUSEFFECT_H |