summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-14 03:54:55 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-14 23:52:45 +0200
commit3805d1384894a33ecb09e4852d47afb04ddb0687 (patch)
tree840b5920d912576554e0e11e67794a726d4a9c4f /src/resources/iteminfo.h
parent36ccecd553539955929f1ce535b8925533922e4e (diff)
downloadmv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.gz
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.bz2
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.xz
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.zip
Replace sprites functionality (need support in client data).
Diffstat (limited to 'src/resources/iteminfo.h')
-rw-r--r--src/resources/iteminfo.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index ba7866518..28f4b2e35 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -108,7 +108,7 @@ class ItemInfo
mDrawBefore(-1),
mDrawAfter(-1),
mDrawPriority(0),
- mRemoveSprite(0),
+ mIsRemoveSprites(false),
mAttackAction(SpriteAction::INVALID),
mAttackRange(0)
{
@@ -209,22 +209,26 @@ class ItemInfo
void setDrawPriority(int n)
{ mDrawPriority = n; }
- int getRemoveSprite() const
- { return mRemoveSprite; }
-
- void setRemoveSprite(int n)
- { mRemoveSprite = n; }
-
std::map<int, int> getTags() const
{ return mTags; }
void addTag(int tag)
{ mTags[tag] = 1; }
- void setRemoveSpriteIds(std::set<int> ids)
- { mRemoveSpriteIds = ids; }
+ void setRemoveSprites()
+ { mIsRemoveSprites = true; }
+
+ bool isRemoveSprites() const
+ { return mIsRemoveSprites; }
+
+ bool isRemoveItemId(int id) const;
+
+ int getReplaceToSpriteId(int id) const;
+
+ std::map<int,int> &addReplaceSprite(int sprite);
- bool isRemoveSpriteId(int id) const;
+ std::map<int, std::map<int, int> > getSpriteToItemReplaceMap() const
+ { return mSpriteToItemReplaceMap; }
protected:
SpriteDisplay mDisplay; /**< Display info (like icon) */
@@ -239,8 +243,9 @@ class ItemInfo
int mDrawBefore;
int mDrawAfter;
int mDrawPriority;
- int mRemoveSprite;
- std::set<int> mRemoveSpriteIds;
+ bool mIsRemoveSprites;
+ // sprite, <itemfrom, itemto>
+ std::map<int, std::map<int, int> > mSpriteToItemReplaceMap;
// Equipment related members.
/** Attack type, in case of weapon.