OpenMW
|
#include <containerstore.hpp>
Public Member Functions | |
ContainerStore () | |
virtual | ~ContainerStore () |
ContainerStoreIterator | begin (int mask=Type_All) |
ContainerStoreIterator | end () |
virtual ContainerStoreIterator | add (const Ptr &itemPtr, const Ptr &actorPtr) |
ContainerStoreIterator | add (const std::string &id, int count, const Ptr &actorPtr) |
Utility to construct a ManualRef and call add(ptr, actorPtr) | |
int | remove (const std::string &itemId, int count, const Ptr &actor) |
virtual int | remove (const Ptr &item, int count, const Ptr &actor) |
void | unstack (const Ptr &ptr, const Ptr &container) |
Unstack an item in this container. The item's count will be set to 1, then a new stack will be added with (origCount-1). | |
virtual bool | stacks (const Ptr &ptr1, const Ptr &ptr2) |
void | fill (const ESM::InventoryList &items, const std::string &owner, const MWWorld::ESMStore &store) |
Insert items into *this. | |
void | clear () |
Empty container. | |
float | getWeight () const |
Return total weight of the items contained in *this. | |
Ptr | search (const std::string &id) |
Static Public Member Functions | |
static int | getType (const Ptr &ptr) |
Static Public Attributes | |
static const int | Type_Potion = 0x0001 |
static const int | Type_Apparatus = 0x0002 |
static const int | Type_Armor = 0x0004 |
static const int | Type_Book = 0x0008 |
static const int | Type_Clothing = 0x0010 |
static const int | Type_Ingredient = 0x0020 |
static const int | Type_Light = 0x0040 |
static const int | Type_Lockpick = 0x0080 |
static const int | Type_Miscellaneous = 0x0100 |
static const int | Type_Probe = 0x0200 |
static const int | Type_Repair = 0x0400 |
static const int | Type_Weapon = 0x0800 |
static const int | Type_Last = Type_Weapon |
static const int | Type_All = 0xffff |
Protected Member Functions | |
ContainerStoreIterator | addNewStack (const Ptr &ptr) |
Add the item to this container (do not try to stack it onto existing items) | |
virtual void | flagAsModified () |
Private Member Functions | |
ContainerStoreIterator | addImp (const Ptr &ptr) |
void | addInitialItem (const std::string &id, const std::string &owner, int count, unsigned char failChance=0, bool topLevel=true) |
Private Attributes | |
MWWorld::CellRefList< ESM::Potion > | potions |
MWWorld::CellRefList < ESM::Apparatus > | appas |
MWWorld::CellRefList< ESM::Armor > | armors |
MWWorld::CellRefList< ESM::Book > | books |
MWWorld::CellRefList < ESM::Clothing > | clothes |
MWWorld::CellRefList < ESM::Ingredient > | ingreds |
MWWorld::CellRefList< ESM::Light > | lights |
MWWorld::CellRefList < ESM::Lockpick > | lockpicks |
MWWorld::CellRefList < ESM::Miscellaneous > | miscItems |
MWWorld::CellRefList< ESM::Probe > | probes |
MWWorld::CellRefList< ESM::Repair > | repairs |
MWWorld::CellRefList< ESM::Weapon > | weapons |
float | mCachedWeight |
bool | mWeightUpToDate |
Friends | |
class | ContainerStoreIterator |
MWWorld::ContainerStore::~ContainerStore | ( | ) | [virtual] |
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add | ( | const Ptr & | itemPtr, |
const Ptr & | actorPtr | ||
) | [virtual] |
Add the item pointed to by ptr to this container. (Stacks automatically if needed)
Reimplemented in MWWorld::InventoryStore.
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add | ( | const std::string & | id, |
int | count, | ||
const Ptr & | actorPtr | ||
) |
Utility to construct a ManualRef and call add(ptr, actorPtr)
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp | ( | const Ptr & | ptr | ) | [private] |
void MWWorld::ContainerStore::addInitialItem | ( | const std::string & | id, |
const std::string & | owner, | ||
int | count, | ||
unsigned char | failChance = 0 , |
||
bool | topLevel = true |
||
) | [private] |
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addNewStack | ( | const Ptr & | ptr | ) | [protected] |
Add the item to this container (do not try to stack it onto existing items)
void MWWorld::ContainerStore::clear | ( | ) |
Empty container.
void MWWorld::ContainerStore::fill | ( | const ESM::InventoryList & | items, |
const std::string & | owner, | ||
const MWWorld::ESMStore & | store | ||
) |
Insert items into *this.
void MWWorld::ContainerStore::flagAsModified | ( | ) | [protected, virtual] |
Reimplemented in MWWorld::InventoryStore.
int MWWorld::ContainerStore::getType | ( | const Ptr & | 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.
int MWWorld::ContainerStore::remove | ( | const Ptr & | item, |
int | count, | ||
const Ptr & | actor | ||
) | [virtual] |
Remove count item(s) designated by item from this inventory.
Reimplemented in MWWorld::InventoryStore.
MWWorld::Ptr MWWorld::ContainerStore::search | ( | const std::string & | id | ) |
bool MWWorld::ContainerStore::stacks | ( | const Ptr & | ptr1, |
const Ptr & | ptr2 | ||
) | [virtual] |
Reimplemented in MWWorld::InventoryStore.
void MWWorld::ContainerStore::unstack | ( | const Ptr & | ptr, |
const Ptr & | container | ||
) |
Unstack an item in this container. The item's count will be set to 1, then a new stack will be added with (origCount-1).
friend class ContainerStoreIterator [friend] |
float MWWorld::ContainerStore::mCachedWeight [mutable, private] |
bool MWWorld::ContainerStore::mWeightUpToDate [mutable, private] |
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_Last = Type_Weapon [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] |