#pragma once #include "ItemType.h" #include "Reader.h" class ItemType; class Item : public virtual Framework::ReferenceCounter { protected: const ItemType *zType; float damage; float maxDamage; float durability; float maxDurability; bool eatable; bool placeable; bool equippable; bool solid; bool usable; int maxStackSize; Framework::Text name; Item( const ItemType *zType, const char *name ); public: virtual void tick(); const ItemType *zItemType() const; float getDamage() const; float getDurability() const; bool isUsable() const; bool isEatable() const; bool isPlaceable() const; bool isEquippable() const; bool isSolid() const; float getMaxDurability() const; int getMaxStackSize() const; float getMaxDamage() const; virtual bool canBeStackedWith( Item *zItem ) const; virtual void applyInventoryEffects( Entity *zTarget ); virtual void removeInventoryEffects( Entity *zTarget ); virtual void applyEquippedEffects( Entity *zTarget ); virtual void removeEquippedEffects( Entity *zTarget ); virtual void applyFoodEffects( Entity *zTarget ); friend ItemType; };