From 0d4fa49a591658989edb5b640d996b9dc93775d2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Aug 2015 21:32:20 +0300 Subject: Rename colors list variables in iteminfo. --- src/resources/iteminfo.cpp | 36 ++++++++++++++++++------------------ src/resources/iteminfo.h | 8 ++++---- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index c439be5c5..52e238a5d 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -59,8 +59,8 @@ ItemInfo::ItemInfo() : mAnimationFiles(), mSounds(), mTags(), - mColors(nullptr), - mColorList(), + mColorsList(nullptr), + mColorsListName(), mHitEffectId(-1), mCriticalHitEffectId(-1), mMissEffectId(-1), @@ -191,24 +191,24 @@ void ItemInfo::setColorsList(const std::string &name) { if (name.empty()) { - mColors = nullptr; - mColorList.clear(); + mColorsList = nullptr; + mColorsListName.clear(); } else { - mColors = ColorDB::getColorsList(name); - mColorList = name; + mColorsList = ColorDB::getColorsList(name); + mColorsListName = name; } } std::string ItemInfo::getDyeColorsString(const ItemColor color) const { - if (!mColors || mColorList.empty()) + if (!mColorsList || mColorsListName.empty()) return ""; const std::map ::const_iterator - it = mColors->find(color); - if (it == mColors->end()) + it = mColorsList->find(color); + if (it == mColorsList->end()) return ""; return it->second.color; @@ -228,11 +228,11 @@ const std::string ItemInfo::replaceColors(std::string str, const ItemColor color) const { std::string name; - if (mColors && !mColorList.empty()) + if (mColorsList && !mColorsListName.empty()) { const std::map ::const_iterator - it = mColors->find(color); - if (it == mColors->end()) + it = mColorsList->find(color); + if (it == mColorsList->end()) name = "unknown"; else name = it->second.name; @@ -371,24 +371,24 @@ void ItemInfo::setSprite(const std::string &animationFile, std::string ItemInfo::getColorName(const ItemColor idx) const { - if (!mColors) + if (!mColorsList) return std::string(); const std::map ::const_iterator - it = mColors->find(idx); - if (it == mColors->end()) + it = mColorsList->find(idx); + if (it == mColorsList->end()) return std::string(); return it->second.name; } std::string ItemInfo::getColor(const ItemColor idx) const { - if (!mColors) + if (!mColorsList) return std::string(); const std::map ::const_iterator - it = mColors->find(idx); - if (it == mColors->end()) + it = mColorsList->find(idx); + if (it == mColorsList->end()) return std::string(); return it->second.color; } diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 976d30c1d..5d7b2f15f 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -244,7 +244,7 @@ class ItemInfo final void setColorsList(const std::string &name); bool isHaveColors() const A_WARN_UNUSED - { return !mColorList.empty(); } + { return !mColorsListName.empty(); } const std::string replaceColors(std::string str, const ItemColor color) @@ -266,7 +266,7 @@ class ItemInfo final { return mProtected; } int getColorsSize() const - { return mColors ? static_cast(mColors->size()) : 0; } + { return mColorsList ? static_cast(mColorsList->size()) : 0; } std::string getColorName(const ItemColor idx) const; @@ -318,8 +318,8 @@ class ItemInfo final /** Stores the names of sounds to be played at certain event. */ std::map mSounds; std::map mTags; - const std::map *mColors; - std::string mColorList; + const std::map *mColorsList; + std::string mColorsListName; int mHitEffectId; int mCriticalHitEffectId; int mMissEffectId; -- cgit v1.2.3-70-g09d2