Item Class Reference
#include <item.h>
List of all members.
Detailed Description
Represents one or more instances of a certain item type.
Definition at line 32 of file item.h.
|
Public Member Functions |
| Item (int id=-1, int quantity=0, bool equipment=false, bool equipped=false) |
| Constructor.
|
| ~Item () |
| Destructor.
|
void | setId (int id) |
| Sets the item id, identifying the item type.
|
int | getId () const |
| Returns the item id.
|
Image * | getImage () |
| 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 | setEquipment (bool equipment) |
| Sets whether this item is considered equipment.
|
bool | isEquipment () const |
| Returns whether this item is considered equipment.
|
void | setEquipped (bool equipped) |
| Sets whether this item is equipped.
|
bool | isEquipped () const |
| Returns whether this item is equipped.
|
void | setInvIndex (int index) |
| Sets the inventory index of this item.
|
int | getInvIndex () const |
| Returns the inventory index of this item.
|
const ItemInfo & | getInfo () const |
| Returns information about this item type.
|
Protected Attributes |
int | mId |
| Item type id.
|
Image * | mImage |
| Item image.
|
int | mQuantity |
| Number of items.
|
bool | mEquipment |
| Item is equipment.
|
bool | mEquipped |
| Item is equipped.
|
int | mInvIndex |
| Inventory index.
|
Constructor & Destructor Documentation
Item::Item |
( |
int |
id = -1 , |
|
|
int |
quantity = 0 , |
|
|
bool |
equipment = false , |
|
|
bool |
equipped = false | |
|
) |
| | |
Constructor.
Definition at line 28 of file item.cpp.
Destructor.
Definition at line 36 of file item.cpp.
Member Function Documentation
void Item::setId |
( |
int |
id |
) |
|
Sets the item id, identifying the item type.
Definition at line 42 of file item.cpp.
int Item::getId |
( |
|
) |
const [inline] |
Returns the item id.
Definition at line 54 of file item.h.
Image* Item::getImage |
( |
|
) |
[inline] |
Returns the item image.
Definition at line 59 of file item.h.
void Item::setQuantity |
( |
int |
quantity |
) |
[inline] |
Sets the number of items.
Definition at line 64 of file item.h.
void Item::increaseQuantity |
( |
int |
amount |
) |
[inline] |
Increases the number of items by the given amount.
Definition at line 69 of file item.h.
int Item::getQuantity |
( |
|
) |
const [inline] |
Returns the number of items.
Definition at line 74 of file item.h.
void Item::setEquipment |
( |
bool |
equipment |
) |
[inline] |
Sets whether this item is considered equipment.
Definition at line 79 of file item.h.
bool Item::isEquipment |
( |
|
) |
const [inline] |
Returns whether this item is considered equipment.
Definition at line 84 of file item.h.
void Item::setEquipped |
( |
bool |
equipped |
) |
[inline] |
Sets whether this item is equipped.
Definition at line 89 of file item.h.
bool Item::isEquipped |
( |
|
) |
const [inline] |
Returns whether this item is equipped.
Definition at line 94 of file item.h.
void Item::setInvIndex |
( |
int |
index |
) |
[inline] |
Sets the inventory index of this item.
Definition at line 99 of file item.h.
int Item::getInvIndex |
( |
|
) |
const [inline] |
Returns the inventory index of this item.
Definition at line 104 of file item.h.
const ItemInfo& Item::getInfo |
( |
|
) |
const [inline] |
Returns information about this item type.
Definition at line 109 of file item.h.
Member Data Documentation
Number of items.
Definition at line 114 of file item.h.
The documentation for this class was generated from the following files: