Represents one or more instances of a certain item type.
More...
#include <item.h>
|
| | Item (int id=-1, int quantity=0, bool equipped=false) |
| |
| virtual | ~Item ()=default |
| |
| void | setId (int id) |
| | Sets the item id, identifying the item type.
|
| |
| int | getId () const |
| | Returns the item id.
|
| |
| Image * | getImage () const |
| | Returns the item image.
|
| |
| void | setQuantity (int quantity) |
| | Sets the number of items.
|
| |
| void | increaseQuantity (int amount) |
| | Increases the number of items by the given amount.
|
| |
| int | getQuantity () const |
| | Returns the number of items.
|
| |
| void | setEquipped (bool equipped) |
| | Sets whether this item is equipped.
|
| |
| bool | isEquipped () const |
| | Returns whether this item is equipped.
|
| |
| bool | isEquippable () const |
| | Returns whether this item is equippable.
|
| |
| void | setInvIndex (int index) |
| | Sets the inventory index of this item.
|
| |
| int | getInvIndex () const |
| | Returns the inventory index of this item.
|
| |
| void | doEvent (Event::Type eventType) |
| |
| void | doEvent (Event::Type eventType, int amount) |
| |
| const ItemInfo & | getInfo () const |
| | Returns information about this item type.
|
| |
Represents one or more instances of a certain item type.
Definition at line 34 of file item.h.
◆ Item()
| Item::Item |
( |
int |
id = -1, |
|
|
int |
quantity = 0, |
|
|
bool |
equipped = false |
|
) |
| |
◆ ~Item()
◆ doEvent() [1/2]
◆ doEvent() [2/2]
| void Item::doEvent |
( |
Event::Type |
eventType, |
|
|
int |
amount |
|
) |
| |
◆ getId()
| int Item::getId |
( |
| ) |
const |
|
inline |
Returns the item id.
Definition at line 49 of file item.h.
◆ getImage()
| Image * Item::getImage |
( |
| ) |
const |
|
inline |
Returns the item image.
Definition at line 54 of file item.h.
◆ getInfo()
| const ItemInfo & Item::getInfo |
( |
| ) |
const |
|
inline |
Returns information about this item type.
Definition at line 103 of file item.h.
◆ getInvIndex()
| int Item::getInvIndex |
( |
| ) |
const |
|
inline |
Returns the inventory index of this item.
Definition at line 94 of file item.h.
◆ getQuantity()
| int Item::getQuantity |
( |
| ) |
const |
|
inline |
Returns the number of items.
Definition at line 69 of file item.h.
◆ increaseQuantity()
| void Item::increaseQuantity |
( |
int |
amount | ) |
|
|
inline |
Increases the number of items by the given amount.
Definition at line 64 of file item.h.
◆ isEquippable()
| bool Item::isEquippable |
( |
| ) |
const |
Returns whether this item is equippable.
Definition at line 69 of file item.cpp.
◆ isEquipped()
| bool Item::isEquipped |
( |
| ) |
const |
|
inline |
Returns whether this item is equipped.
Definition at line 79 of file item.h.
◆ setEquipped()
| void Item::setEquipped |
( |
bool |
equipped | ) |
|
|
inline |
Sets whether this item is equipped.
Definition at line 74 of file item.h.
◆ setId()
| void Item::setId |
( |
int |
id | ) |
|
Sets the item id, identifying the item type.
Definition at line 38 of file item.cpp.
◆ setInvIndex()
| void Item::setInvIndex |
( |
int |
index | ) |
|
|
inline |
Sets the inventory index of this item.
Definition at line 89 of file item.h.
◆ setQuantity()
| void Item::setQuantity |
( |
int |
quantity | ) |
|
|
inline |
Sets the number of items.
Definition at line 59 of file item.h.
◆ mEquipped
◆ mId
◆ mImage
◆ mInvIndex
◆ mQuantity
Number of items.
Definition at line 108 of file item.h.
The documentation for this class was generated from the following files: