Base class for items.
More...
#include <Item.hpp>
◆ Item() [1/2]
| Item::Item |
( |
int |
id, |
|
|
std::string |
name, |
|
|
bool |
isStackable = false |
|
) |
| |
◆ Item() [2/2]
◆ getId()
| const int & Item::getId |
( |
| ) |
|
Get the type id of the item.
- Returns
- const int&
◆ getInstanceId()
| const int & Item::getInstanceId |
( |
| ) |
|
Get the instance id of the item.
- Returns
- const int&
◆ getName()
| const std::string & Item::getName |
( |
| ) |
|
Get the name of the item.
- Returns
- const std::string&
◆ getStackSize()
| const unsigned int & Item::getStackSize |
( |
| ) |
|
Get the stack size of the item.
- Returns
- const unsigned int&
◆ IsStackable()
| const bool & Item::IsStackable |
( |
| ) |
|
Get whether the item is stackable or not.
- Returns
- const bool&
◆ use()
| bool Item::use |
( |
Entity * |
user | ) |
|
|
virtual |
Function for using the item. This base class of items cannot be used, but derived classes should override this function.
- Parameters
-
- Returns
- bool (if returns true, item should be deleted)
Reimplemented in FoodItem, and EquippableItem.
◆ idM
◆ instanceIdM
◆ isStackableM
◆ nameM
◆ nextInstanceIdM
| int Item::nextInstanceIdM = 0 |
|
inlinestaticprotected |
◆ stackSizeM
| const unsigned int Item::stackSizeM = 1 |
|
protected |
TODO: Implement amount functionality for stackable items.
The documentation for this class was generated from the following files: