ManaPlus
|
#include <complexinventory.h>
Public Member Functions | |
ComplexInventory (const InventoryTypeT type, const int size) | |
~ComplexInventory () | |
bool | addVirtualItem (const Item *const item, int index, const int amount) |
void | setItem (const int index, const int id, const ItemTypeT type, const int quantity, const uint8_t refine, const ItemColor color, const Identified identified, const Damaged damaged, const Favorite favorite, const Equipm equipment, const Equipped equipped) |
Public Member Functions inherited from Inventory | |
Inventory (const InventoryTypeT type, const int size) | |
virtual | ~Inventory () |
unsigned | getSize () const |
Item * | getItem (const int index) const |
Item * | findItem (const int itemId, const ItemColor color) const |
int | addItem (const int id, const ItemTypeT type, const int quantity, const uint8_t refine, const ItemColor color, const Identified identified, const Damaged damaged, const Favorite favorite, const Equipm equipment, const Equipped equipped) |
void | setCards (const int index, const int *const cards, const int size) const |
void | setOptions (const int index, const ItemOptionsList *const options) |
void | setTag (const int index, const int tag) |
void | moveItem (const int index1, const int index2) |
void | removeItem (const int id) |
void | removeItemAt (const int index) |
bool | contains (const Item *const item) const |
int | getFreeSlot () const |
void | clear () |
int | getNumberOfSlotsUsed () const |
int | getLastUsedSlot () const |
void | addInventoyListener (InventoryListener *const listener) |
void | removeInventoyListener (InventoryListener *const listener) |
InventoryTypeT | getType () const |
bool | isMainInventory () const |
const Item * | findItemBySprite (std::string spritePath, const GenderT gender, const BeingTypeId race) const |
std::string | getName () const |
void | resize (const unsigned int newSize) |
int | findIndexByTag (const int tag) const |
Item * | findItemByTag (const int tag) const |
void | virtualRemove (Item *const item, const int amount) |
void | virtualRestore (const Item *const item, const int amount) |
void | restoreVirtuals () |
Additional Inherited Members | |
Static Public Attributes inherited from Inventory | |
static const int | NO_SLOT_INDEX = -1 |
Protected Types inherited from Inventory | |
typedef std::list< InventoryListener * > | InventoryListenerList |
Protected Member Functions inherited from Inventory | |
void | distributeSlotsChangedEvent () |
Protected Attributes inherited from Inventory | |
InventoryListenerList | mInventoryListeners |
IntMap | mVirtualRemove |
InventoryTypeT | mType |
unsigned | mSize |
Item ** | mItems |
int | mUsed |
Definition at line 31 of file complexinventory.h.
ComplexInventory::ComplexInventory | ( | const InventoryTypeT | type, |
const int | size | ||
) |
Constructor.
size | the number of items that fit in the inventory |
Definition at line 36 of file complexinventory.cpp.
ComplexInventory::~ComplexInventory | ( | ) |
|
virtual |
Reimplemented from Inventory.
Definition at line 46 of file complexinventory.cpp.
References ComplexItem::addChild(), Inventory::addItem(), CAST_S32, Equipm_false, Equipped_false, Item::getColor(), Item::getDamaged(), Item::getFavorite(), Item::getId(), Item::getIdentified(), Item::getInvIndex(), Inventory::getItem(), Item::getQuantity(), Item::getRefine(), Item::getTag(), Item::getType(), PlayerInfo::isItemProtected(), Inventory::mItems, Inventory::mSize, and Item::setTag().
Referenced by NpcDialog::action(), and NpcDialog::addCraftItem().
|
virtual |
Sets the item at the given position.
Reimplemented from Inventory.
Definition at line 120 of file complexinventory.cpp.
References ComplexItem::addChild(), CAST_S32, Inventory::distributeSlotsChangedEvent(), MailMessageType::Item, Logger::log(), logger, Inventory::mItems, Inventory::mSize, Inventory::mUsed, and Item::setInvIndex().