From a4252ba2050b16a53247335cdddd7aa13a532239 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Jul 2011 03:42:09 +0300 Subject: Add removing palyers sprite logic depend on players direction. --- src/resources/iteminfo.h | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'src/resources/iteminfo.h') 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, +typedef std::map > 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 &addReplaceSprite(int sprite); + std::map *addReplaceSprite(int sprite, int direction); - std::map > 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, - std::map > mSpriteToItemReplaceMap; + // sprite, [direction] + SpriteToItemMap *mSpriteToItemReplaceMap[9]; + + std::vector mSpriteToItemReplaceList; // Equipment related members. /** Attack type, in case of weapon. -- cgit v1.2.3-70-g09d2