From 67ca22e33cc7227048121895bec75e546a3777ef Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Apr 2013 02:15:39 +0300 Subject: improve colordb class. --- src/resources/colordb.cpp | 5 +++-- src/resources/colordb.h | 3 ++- src/resources/iteminfo.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/resources') diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index d664b2d5b..42669b700 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -120,7 +120,7 @@ void ColorDB::loadColorLists() { if (xmlNameEqual(node, "list")) { - std::string name = XML::getProperty(node, "name", ""); + const std::string name = XML::getProperty(node, "name", ""); if (name.empty()) continue; @@ -185,7 +185,8 @@ int ColorDB::getHairSize() return mHairColorsSize; } -std::map *ColorDB::getColorsList(std::string name) +const std::map + *ColorDB::getColorsList(const std::string &name) { const ColorListsIterator it = mColorLists.find(name); diff --git a/src/resources/colordb.h b/src/resources/colordb.h index 75fff94a3..d39abbe9d 100644 --- a/src/resources/colordb.h +++ b/src/resources/colordb.h @@ -75,7 +75,8 @@ namespace ColorDB int getHairSize() A_WARN_UNUSED; - std::map *getColorsList(std::string name) A_WARN_UNUSED; + const std::map *getColorsList(const std::string + &name) A_WARN_UNUSED; // Color DB typedef std::map Colors; diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index afea431ee..380624b7b 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -330,7 +330,7 @@ class ItemInfo final /** Stores the names of sounds to be played at certain event. */ std::map mSounds; std::map mTags; - std::map *mColors; + const std::map *mColors; std::string mColorList; int mHitEffectId; int mCriticalHitEffectId; -- cgit v1.2.3-70-g09d2