1 #ifndef GAME_MWWORLD_CONTAINERSTORE_H
2 #define GAME_MWWORLD_CONTAINERSTORE_H
27 struct InventoryState;
32 class ContainerStoreIterator;
88 void addInitialItem (
const std::string&
id,
const std::string& owner,
int count,
bool topLevel=
true,
const std::string& levItem =
"");
100 bool equipable =
false)
const;
132 int remove(
const std::string& itemId,
int count,
const Ptr& actor);
137 virtual int remove(
const Ptr& item,
int count,
const Ptr& actor);
153 int count (
const std::string&
id);
174 virtual void clear();
197 :
public std::iterator<std::forward_iterator_tag, Ptr, std::ptrdiff_t, Ptr *, Ptr&>
Iteration over a subset of objects in a ContainerStore.
Definition: containerstore.hpp:196
Used to create pointers to hold any type of LiveCellRef<> object.
Definition: livecellref.hpp:22
ContainerStoreListener * getContListener() const
Definition: containerstore.cpp:139
MWWorld::CellRefList< ESM::Apparatus > appas
Definition: containerstore.hpp:67
virtual void writeState(ESM::InventoryState &state) const
Definition: containerstore.cpp:729
MWWorld::CellRefList< ESM::Apparatus >::List::iterator mApparatus
Definition: containerstore.hpp:205
virtual ContainerStore * clone()
Definition: containerstore.hpp:111
void incType()
Definition: containerstore.cpp:837
MWWorld::CellRefList< ESM::Miscellaneous > miscItems
Definition: containerstore.hpp:74
static const int Type_Clothing
Definition: containerstore.hpp:49
static const int Type_Light
Definition: containerstore.hpp:51
MWWorld::CellRefList< ESM::Probe > probes
Definition: containerstore.hpp:75
ContainerStoreIterator begin(int mask=Type_All)
Definition: containerstore.cpp:120
MWWorld::CellRefList< ESM::Potion >::List::iterator mPotion
Definition: containerstore.hpp:204
bool operator==(const LiveCellRef< X > &ref, int pRefnum)
Definition: cellstore.cpp:205
virtual void flagAsModified()
Definition: containerstore.cpp:577
void restock(const ESM::InventoryList &items, const MWWorld::Ptr &ptr, const std::string &owner)
Definition: containerstore.cpp:484
virtual bool stacks(const ConstPtr &ptr1, const ConstPtr &ptr2)
Definition: containerstore.cpp:192
ContainerStoreIterator addNewStack(const ConstPtr &ptr, int count)
Add the item to this container (do not try to stack it onto existing items)
Definition: containerstore.cpp:355
MWWorld::CellRefList< ESM::Armor > armors
Definition: containerstore.hpp:68
MWWorld::CellRefList< ESM::Ingredient >::List::iterator mIngredient
Definition: containerstore.hpp:209
int getType() const
Definition: containerstore.cpp:1079
bool mWeightUpToDate
Definition: containerstore.hpp:86
InventoryList, NPCO subrecord.
Definition: loadcont.hpp:26
virtual void readEquipmentState(const MWWorld::ContainerStoreIterator &iter, int index, const ESM::InventoryState &inventory)
Definition: containerstore.cpp:86
static const int Type_Armor
Definition: containerstore.hpp:47
static const int Type_Ingredient
Definition: containerstore.hpp:50
virtual ~ContainerStore()
Definition: containerstore.cpp:118
Definition: livecellref.hpp:77
static const int Type_Apparatus
Definition: containerstore.hpp:46
static const int Type_Weapon
Definition: containerstore.hpp:56
MWWorld::CellRefList< ESM::Book > books
Definition: containerstore.hpp:69
MWWorld::CellRefList< ESM::Clothing >::List::iterator mClothing
Definition: containerstore.hpp:208
bool isEqual(const ContainerStoreIterator &iter) const
Definition: containerstore.cpp:1051
ContainerStoreListener * mListener
Definition: containerstore.hpp:83
static const int Type_Last
Definition: containerstore.hpp:58
static const int Type_Repair
Definition: containerstore.hpp:55
static const std::string sGoldId
Definition: containerstore.hpp:62
MWWorld::CellRefList< ESM::Miscellaneous >::List::iterator mMiscellaneous
Definition: containerstore.hpp:212
MWWorld::CellRefList< ESM::Repair >::List::iterator mRepair
Definition: containerstore.hpp:214
Ptr operator*() const
Definition: containerstore.cpp:1004
void fill(const ESM::InventoryList &items, const std::string &owner)
Insert items into *this.
Definition: containerstore.cpp:422
int mMask
Definition: containerstore.hpp:200
MWWorld::CellRefList< ESM::Repair > repairs
Definition: containerstore.hpp:76
virtual void itemAdded(const ConstPtr &item, int count)
Definition: containerstore.hpp:37
MWWorld::CellRefList< ESM::Book >::List::iterator mBook
Definition: containerstore.hpp:207
float getWeight() const
Return total weight of the items contained in *this.
Definition: containerstore.cpp:582
ContainerStoreIterator & operator++()
Definition: containerstore.cpp:1032
Ptr search(const std::string &id)
Definition: containerstore.cpp:652
MWWorld::CellRefList< ESM::Ingredient > ingreds
Definition: containerstore.hpp:71
static const int Type_Book
Definition: containerstore.hpp:48
MWWorld::CellRefList< ESM::Weapon > weapons
Definition: containerstore.hpp:77
Definition: containerstore.hpp:34
ContainerStoreIterator addImp(const Ptr &ptr, int count)
Definition: containerstore.cpp:312
<
Definition: objectstate.hpp:19
MWWorld::CellRefList< ESM::Clothing > clothes
Definition: containerstore.hpp:70
void nextType()
Definition: containerstore.cpp:850
virtual void clear()
Empty container.
Definition: containerstore.cpp:569
MWWorld::ContainerStoreIterator restack(const MWWorld::Ptr &item)
Definition: containerstore.cpp:164
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
virtual ContainerStoreIterator add(const Ptr &itemPtr, int count, const Ptr &actorPtr, bool setOwner=false)
Definition: containerstore.cpp:236
MWWorld::CellRefList< ESM::Lockpick > lockpicks
Definition: containerstore.hpp:73
static const int Type_Probe
Definition: containerstore.hpp:54
State for inventories and containers.
Definition: inventorystate.hpp:16
MWWorld::CellRefList< ESM::Potion > potions
Definition: containerstore.hpp:66
void setContListener(ContainerStoreListener *listener)
Definition: containerstore.cpp:145
Definition: containerstore.hpp:41
ContainerStoreIterator end()
Definition: containerstore.cpp:125
ContainerStoreIterator getState(CellRefList< T > &collection, const ESM::ObjectState &state)
static const int Type_Potion
Definition: containerstore.hpp:45
virtual void storeEquipmentState(const MWWorld::LiveCellRefBase &ref, int index, ESM::InventoryState &inventory) const
Definition: containerstore.cpp:82
static const int Type_All
Definition: containerstore.hpp:60
ContainerStore * mContainer
Definition: containerstore.hpp:201
void storeState(const LiveCellRef< T > &ref, ESM::ObjectState &state) const
Definition: containerstore.cpp:91
Ptr mPtr
Definition: containerstore.hpp:202
const ContainerStore * getContainerStore() const
Definition: containerstore.cpp:1084
int mType
Definition: containerstore.hpp:199
ContainerStore()
Definition: containerstore.cpp:116
static int getType(const ConstPtr &ptr)
Definition: containerstore.cpp:607
std::map< std::pair< std::string, std::string >, int > mLevelledItemMap
Definition: containerstore.hpp:79
void addInitialItem(const std::string &id, const std::string &owner, int count, bool topLevel=true, const std::string &levItem="")
Definition: containerstore.cpp:434
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
MWWorld::CellRefList< ESM::Probe >::List::iterator mProbe
Definition: containerstore.hpp:213
bool incIterator()
Definition: containerstore.cpp:930
bool operator!=(const CellStore &left, const CellStore &right)
Definition: cellstore.cpp:935
MWWorld::CellRefList< ESM::Weapon >::List::iterator mWeapon
Definition: containerstore.hpp:215
MWWorld::CellRefList< ESM::Light > lights
Definition: containerstore.hpp:72
ContainerStoreIterator unstack(const Ptr &ptr, const Ptr &container, int count=1)
Definition: containerstore.cpp:150
MWWorld::CellRefList< ESM::Light >::List::iterator mLight
Definition: containerstore.hpp:210
static const int Type_Miscellaneous
Definition: containerstore.hpp:53
virtual void itemRemoved(const ConstPtr &item, int count)
Definition: containerstore.hpp:38
int count(const std::string &id)
Definition: containerstore.cpp:130
MWWorld::CellRefList< ESM::Armor >::List::iterator mArmor
Definition: containerstore.hpp:206
void storeStates(const CellRefList< T > &collection, ESM::InventoryState &inventory, int &index, bool equipable=false) const
Definition: containerstore.cpp:97
float mCachedWeight
Definition: containerstore.hpp:85
static const int Type_Lockpick
Definition: containerstore.hpp:52
ContainerStoreIterator(ContainerStore *container)
End-iterator.
Definition: containerstore.cpp:792
bool resetIterator()
Definition: containerstore.cpp:862
ContainerStoreIterator & operator=(const ContainerStoreIterator &rhs)
Definition: containerstore.cpp:1115
Ptr * operator->() const
Definition: containerstore.cpp:998
void copy(const ContainerStoreIterator &src)
Definition: containerstore.cpp:1089
virtual void readState(const ESM::InventoryState &state)
Definition: containerstore.cpp:750
MWWorld::CellRefList< ESM::Lockpick >::List::iterator mLockpick
Definition: containerstore.hpp:211