summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-25 03:42:09 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-25 03:42:09 +0300
commita4252ba2050b16a53247335cdddd7aa13a532239 (patch)
tree19a41cf0b1c546d5b1cc217194a1fe0a477d545d /src/resources/iteminfo.h
parent4afb49eb81f590c2bce56ed28f237a9bf0e2a093 (diff)
downloadmanaplus-a4252ba2050b16a53247335cdddd7aa13a532239.tar.gz
manaplus-a4252ba2050b16a53247335cdddd7aa13a532239.tar.bz2
manaplus-a4252ba2050b16a53247335cdddd7aa13a532239.tar.xz
manaplus-a4252ba2050b16a53247335cdddd7aa13a532239.zip
Add removing palyers sprite logic depend on players direction.
Diffstat (limited to 'src/resources/iteminfo.h')
-rw-r--r--src/resources/iteminfo.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index d0a577f6d..b977a94ce 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -92,6 +92,9 @@ enum ItemType
ITEM_SPRITE_HAIR // 15
};
+// sprite, <itemfrom, itemto>
+typedef std::map<int, std::map<int, int> > SpriteToItemMap;
+
/**
* Defines a class for storing item infos. This includes information used when
* the item is equipped.
@@ -102,23 +105,11 @@ class ItemInfo
/**
* Constructor.
*/
- ItemInfo():
- mType(ITEM_UNUSABLE),
- mWeight(0),
- mView(0),
- mId(0),
- mDrawBefore(-1),
- mDrawAfter(-1),
- mDrawPriority(0),
- mIsRemoveSprites(false),
- mAttackAction(SpriteAction::INVALID),
- mAttackRange(0),
- mColors(0),
- mColorList(""),
- mHitEffectId(0),
- mCriticalHitEffectId(0)
- {
- }
+ ItemInfo();
+
+ ItemInfo(ItemInfo &info);
+
+ ~ItemInfo();
void setId(int id)
{ mId = id; }
@@ -253,10 +244,9 @@ class ItemInfo
int getReplaceToSpriteId(int id) const;
- std::map<int, int> &addReplaceSprite(int sprite);
+ std::map<int, int> *addReplaceSprite(int sprite, int direction);
- std::map<int, std::map<int, int> > getSpriteToItemReplaceMap() const
- { return mSpriteToItemReplaceMap; }
+ SpriteToItemMap *getSpriteToItemReplaceMap(int directions) const;
std::string getDyeString(int color) const;
@@ -285,8 +275,10 @@ class ItemInfo
int mDrawAfter;
int mDrawPriority;
bool mIsRemoveSprites;
- // sprite, <itemfrom, itemto>
- std::map<int, std::map<int, int> > mSpriteToItemReplaceMap;
+ // sprite, <itemfrom, itemto> [direction]
+ SpriteToItemMap *mSpriteToItemReplaceMap[9];
+
+ std::vector<SpriteToItemMap*> mSpriteToItemReplaceList;
// Equipment related members.
/** Attack type, in case of weapon.