diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-15 02:15:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-15 02:15:39 +0300 |
commit | 67ca22e33cc7227048121895bec75e546a3777ef (patch) | |
tree | 08d897013784943f435265d99638dd96e7d9d7b5 | |
parent | 60019d36cc08faa4d49f2ddb048f6a71cf87a683 (diff) | |
download | manaplus-67ca22e33cc7227048121895bec75e546a3777ef.tar.gz manaplus-67ca22e33cc7227048121895bec75e546a3777ef.tar.bz2 manaplus-67ca22e33cc7227048121895bec75e546a3777ef.tar.xz manaplus-67ca22e33cc7227048121895bec75e546a3777ef.zip |
improve colordb class.
-rw-r--r-- | src/resources/colordb.cpp | 5 | ||||
-rw-r--r-- | src/resources/colordb.h | 3 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 2 |
3 files changed, 6 insertions, 4 deletions
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 <int, ColorDB::ItemColor> *ColorDB::getColorsList(std::string name) +const std::map <int, ColorDB::ItemColor> + *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 <int, ItemColor> *getColorsList(std::string name) A_WARN_UNUSED; + const std::map <int, ItemColor> *getColorsList(const std::string + &name) A_WARN_UNUSED; // Color DB typedef std::map<int, ItemColor> 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 <EquipmentSoundEvent, StringVect> mSounds; std::map <int, int> mTags; - std::map <int, ColorDB::ItemColor> *mColors; + const std::map <int, ColorDB::ItemColor> *mColors; std::string mColorList; int mHitEffectId; int mCriticalHitEffectId; |