37 Item(
int id = -1,
int quantity = 0,
bool equipped =
false);
Defines a class for loading and storing images.
const ItemInfo & get(int id) const
Defines a class for storing generic item infos.
Represents one or more instances of a certain item type.
void setQuantity(int quantity)
Sets the number of items.
int mQuantity
Number of items.
bool mEquipped
Item is equipped.
int mInvIndex
Inventory index.
void doEvent(Event::Type eventType)
bool isEquipped() const
Returns whether this item is equipped.
int getQuantity() const
Returns the number of items.
int getInvIndex() const
Returns the inventory index of this item.
void increaseQuantity(int amount)
Increases the number of items by the given amount.
void setEquipped(bool equipped)
Sets whether this item is equipped.
ResourceRef< Image > mImage
Item image.
int getId() const
Returns the item id.
Image * getImage() const
Returns the item image.
void setId(int id)
Sets the item id, identifying the item type.
void setInvIndex(int index)
Sets the inventory index of this item.
bool isEquippable() const
Returns whether this item is equippable.
const ItemInfo & getInfo() const
Returns information about this item type.
Automatically counting Resource reference.
ItemDB * itemDb
Items info database.