#include <containerstore.hpp>
|
| | ContainerStore () |
| |
| virtual | ~ContainerStore () |
| |
| virtual ContainerStore * | clone () |
| |
| ConstContainerStoreIterator | cbegin (int mask=Type_All) const |
| |
| ConstContainerStoreIterator | cend () const |
| |
| ConstContainerStoreIterator | begin (int mask=Type_All) const |
| |
| ConstContainerStoreIterator | end () const |
| |
| ContainerStoreIterator | begin (int mask=Type_All) |
| |
| ContainerStoreIterator | end () |
| |
| virtual ContainerStoreIterator | add (const Ptr &itemPtr, int count, const Ptr &actorPtr, bool setOwner=false) |
| |
| ContainerStoreIterator | add (const std::string &id, int count, const Ptr &actorPtr) |
| | Utility to construct a ManualRef and call add(ptr, count, actorPtr, true) More...
|
| |
| int | remove (const std::string &itemId, int count, const Ptr &actor) |
| |
| virtual int | remove (const Ptr &item, int count, const Ptr &actor) |
| |
| ContainerStoreIterator | unstack (const Ptr &ptr, const Ptr &container, int count=1) |
| |
| MWWorld::ContainerStoreIterator | restack (const MWWorld::Ptr &item) |
| |
| int | count (const std::string &id) |
| |
| int | restockCount (const std::string &id) |
| |
| ContainerStoreListener * | getContListener () const |
| |
| void | setContListener (ContainerStoreListener *listener) |
| |
| virtual bool | stacks (const ConstPtr &ptr1, const ConstPtr &ptr2) const |
| |
| void | fill (const ESM::InventoryList &items, const std::string &owner) |
| | Insert items into *this. More...
|
| |
| void | restock (const ESM::InventoryList &items, const MWWorld::Ptr &ptr, const std::string &owner) |
| |
| virtual void | clear () |
| | Empty container. More...
|
| |
| float | getWeight () const |
| | Return total weight of the items contained in *this. More...
|
| |
| Ptr | findReplacement (const std::string &id) |
| | Returns replacement for object with given id. Prefer used items (with low durability left). More...
|
| |
| Ptr | search (const std::string &id) |
| |
| virtual void | writeState (ESM::InventoryState &state) const |
| |
| virtual void | readState (const ESM::InventoryState &state) |
| |
| template<typename T > |
| MWWorld::ContainerStoreIterator | getState (CellRefList< T > &collection, const ESM::ObjectState &state) |
| |
|
| ContainerStoreIterator | addImp (const Ptr &ptr, int count) |
| |
| void | addInitialItem (const std::string &id, const std::string &owner, int count, bool topLevel=true, const std::string &levItem="") |
| |
| template<typename T > |
| ContainerStoreIterator | getState (CellRefList< T > &collection, const ESM::ObjectState &state) |
| |
| template<typename T > |
| void | storeState (const LiveCellRef< T > &ref, ESM::ObjectState &state) const |
| |
| template<typename T > |
| void | storeStates (const CellRefList< T > &collection, ESM::InventoryState &inventory, int &index, bool equipable=false) const |
| |
| virtual void | storeEquipmentState (const MWWorld::LiveCellRefBase &ref, int index, ESM::InventoryState &inventory) const |
| |
| virtual void | readEquipmentState (const MWWorld::ContainerStoreIterator &iter, int index, const ESM::InventoryState &inventory) |
| |
| MWWorld::ContainerStore::ContainerStore |
( |
| ) |
|
| MWWorld::ContainerStore::~ContainerStore |
( |
| ) |
|
|
virtual |
Add the item pointed to by ptr to this container. (Stacks automatically if needed)
- Note
- The item pointed to is not required to exist beyond this function call.
- Attention
- Do not add items to an existing stack by increasing the count instead of calling this function!
- Parameters
-
| setOwner | Set the owner of the added item to actorPtr? If false, the owner is reset to "". |
- Returns
- if stacking happened, return iterator to the item that was stacked against, otherwise iterator to the newly inserted item.
Reimplemented in MWWorld::InventoryStore.
Utility to construct a ManualRef and call add(ptr, count, actorPtr, true)
| void MWWorld::ContainerStore::addInitialItem |
( |
const std::string & |
id, |
|
|
const std::string & |
owner, |
|
|
int |
count, |
|
|
bool |
topLevel = true, |
|
|
const std::string & |
levItem = "" |
|
) |
| |
|
private |
Add the item to this container (do not try to stack it onto existing items)
| void MWWorld::ContainerStore::clear |
( |
| ) |
|
|
virtual |
| int MWWorld::ContainerStore::count |
( |
const std::string & |
id | ) |
|
- Returns
- How many items with refID id are in this container?
| void MWWorld::ContainerStore::fill |
( |
const ESM::InventoryList & |
items, |
|
|
const std::string & |
owner |
|
) |
| |
| MWWorld::Ptr MWWorld::ContainerStore::findReplacement |
( |
const std::string & |
id | ) |
|
Returns replacement for object with given id. Prefer used items (with low durability left).
| void MWWorld::ContainerStore::flagAsModified |
( |
| ) |
|
|
protectedvirtual |
| int MWWorld::ContainerStore::getType |
( |
const ConstPtr & |
ptr | ) |
|
|
static |
This function throws an exception, if ptr does not point to an object, that can be put into a container.
| float MWWorld::ContainerStore::getWeight |
( |
| ) |
const |
Return total weight of the items contained in *this.
| int MWWorld::ContainerStore::remove |
( |
const std::string & |
itemId, |
|
|
int |
count, |
|
|
const Ptr & |
actor |
|
) |
| |
Remove count item(s) designated by itemId from this container.
- Returns
- the number of items actually removed
| int MWWorld::ContainerStore::remove |
( |
const Ptr & |
item, |
|
|
int |
count, |
|
|
const Ptr & |
actor |
|
) |
| |
|
virtual |
Remove count item(s) designated by item from this inventory.
- Returns
- the number of items actually removed
Reimplemented in MWWorld::InventoryStore.
Attempt to re-stack an item in this container. If a compatible stack is found, the item's count is added to that stack, then the original is deleted.
- Returns
- If the item was stacked, return the stack, otherwise return the old (untouched) item.
| int MWWorld::ContainerStore::restockCount |
( |
const std::string & |
id | ) |
|
Item count with restock adjustments (such as ignoring filled soul gems).
- Returns
- How many items with refID id are in this container?
| MWWorld::Ptr MWWorld::ContainerStore::search |
( |
const std::string & |
id | ) |
|
Unstack an item in this container. The item's count will be set to count, then a new stack will be added with (origCount-count).
- Returns
- an iterator to the new stack, or end() if no new stack was created.
| float MWWorld::ContainerStore::mCachedWeight |
|
mutableprivate |
| std::map<std::pair<std::string, std::string>, int> MWWorld::ContainerStore::mLevelledItemMap |
|
private |
Stores result of levelled item spawns. <(refId, spawningGroup), count> This is used to restock levelled items(s) if the old item was sold.
| bool MWWorld::ContainerStore::mWeightUpToDate |
|
mutableprivate |
| const std::string MWWorld::ContainerStore::sGoldId = "gold_001" |
|
static |
| const int MWWorld::ContainerStore::Type_All = 0xffff |
|
static |
| const int MWWorld::ContainerStore::Type_Apparatus = 0x0002 |
|
static |
| const int MWWorld::ContainerStore::Type_Armor = 0x0004 |
|
static |
| const int MWWorld::ContainerStore::Type_Book = 0x0008 |
|
static |
| const int MWWorld::ContainerStore::Type_Clothing = 0x0010 |
|
static |
| const int MWWorld::ContainerStore::Type_Ingredient = 0x0020 |
|
static |
| const int MWWorld::ContainerStore::Type_Light = 0x0040 |
|
static |
| const int MWWorld::ContainerStore::Type_Lockpick = 0x0080 |
|
static |
| const int MWWorld::ContainerStore::Type_Miscellaneous = 0x0100 |
|
static |
| const int MWWorld::ContainerStore::Type_Potion = 0x0001 |
|
static |
| const int MWWorld::ContainerStore::Type_Probe = 0x0200 |
|
static |
| const int MWWorld::ContainerStore::Type_Repair = 0x0400 |
|
static |
| const int MWWorld::ContainerStore::Type_Weapon = 0x0800 |
|
static |
The documentation for this class was generated from the following files: