diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-04 15:50:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-04 15:50:56 +0300 |
commit | d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb (patch) | |
tree | 33e51821fd54d88d46df4e328f60ba148971ca55 /src/resources | |
parent | 39cec87cfa8b1605239f4b06388bbb07f2a16a89 (diff) | |
download | manaplus-d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb.tar.gz manaplus-d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb.tar.bz2 manaplus-d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb.tar.xz manaplus-d0adcf0e3c8a1db5e06bbbb8ae950ea5ebeeb8eb.zip |
Add stringmap typedefs.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/db/itemdb.cpp | 3 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 45fda0e66..da8072980 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -39,6 +39,7 @@ #include "utils/delete2.h" #include "utils/dtor.h" +#include "utils/stringmap.h" #include "debug.h" @@ -50,7 +51,7 @@ namespace bool mLoaded = false; bool mConstructed = false; StringVect mTagNames; - std::map<std::string, int> mTags; + StringIntMap mTags; std::map<std::string, ItemSoundEvent::Type> mSoundNames; } // namespace diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 337b76df4..c2ccd9dc5 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -45,6 +45,7 @@ #include "utils/base64.h" #include "utils/delete2.h" +#include "utils/stringmap.h" #include <iostream> #include <zlib.h> @@ -969,7 +970,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node, if (isProps) { // read tile properties to a map for simpler handling - std::map<std::string, int> tileProperties; + StringIntMap tileProperties; for_each_xml_child_node(propertyNode, tileNode) { if (!xmlNameEqual(propertyNode, "property")) @@ -998,9 +999,9 @@ Tileset *MapReader::readTileset(XmlNodePtr node, for (int i = 0; ; i++) { const std::string iStr(toString(i)); - const std::map<std::string, int>::const_iterator iFrame + StringIntMapCIter iFrame = tileProperties.find("animation-frame" + iStr); - const std::map<std::string, int>::const_iterator iDelay + StringIntMapCIter iDelay = tileProperties.find("animation-delay" + iStr); // possible need add random attribute? if (iFrame != tileProperties.end() |