summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemdb.cpp7
-rw-r--r--src/resources/itemdb.h3
-rw-r--r--src/resources/iteminfo.h6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 385f32ee6..71b88d192 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -343,11 +343,16 @@ void ItemDB::load()
mLoaded = true;
}
-std::vector<std::string> &ItemDB::getTags()
+const std::vector<std::string> &ItemDB::getTags()
{
return mTagNames;
}
+int ItemDB::getTagId(std::string tagName)
+{
+ return mTags[tagName];
+}
+
void ItemDB::unload()
{
logger->log1("Unloading item database...");
diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h
index 54e8ceb33..19e36889e 100644
--- a/src/resources/itemdb.h
+++ b/src/resources/itemdb.h
@@ -50,7 +50,7 @@ namespace ItemDB
*/
void unload();
- std::vector<std::string> &getTags();
+ const std::vector<std::string> &getTags();
bool exists(int id);
@@ -63,6 +63,7 @@ namespace ItemDB
const std::map<int, ItemInfo*> &getItemInfos();
+ int getTagId(std::string tagName);
struct Stat
{
Stat(const std::string &tag,
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 3ccbf01ec..19bba335d 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -207,11 +207,11 @@ class ItemInfo
void setDrawPriority(int n)
{ mDrawPriority = n; }
- std::set<int> &getTags()
+ std::map<int, int> getTags()
{ return mTags; }
void addTag(int tag)
- { mTags.insert(tag); }
+ { mTags[tag] = 1; }
protected:
SpriteDisplay mDisplay; /**< Display info (like icon) */
@@ -243,7 +243,7 @@ class ItemInfo
/** Stores the names of sounds to be played at certain event. */
std::map < EquipmentSoundEvent, std::vector<std::string> > mSounds;
- std::set <int> mTags;
+ std::map <int,int> mTags;
};
#endif