1 #ifndef MWGUI_CONTAINER_ITEM_MODEL_H
2 #define MWGUI_CONTAINER_ITEM_MODEL_H
14 ContainerItemModel (
const std::vector<MWWorld::Ptr>& itemSources,
const std::vector<MWWorld::Ptr>& worldItems);
The base class that all item models should derive from.
Definition: itemmodel.hpp:43
std::vector< ItemStack > mItems
Definition: containeritemmodel.hpp:33
The container item model supports multiple item sources, which are needed for making NPCs sell items ...
Definition: containeritemmodel.hpp:11
virtual MWWorld::Ptr copyItem(const ItemStack &item, size_t count, bool setNewOwner=false)
Definition: containeritemmodel.cpp:74
virtual ModelIndex getIndex(ItemStack item)
Returns an invalid index if the item was not found.
Definition: containeritemmodel.cpp:62
virtual void removeItem(const ItemStack &item, size_t count)
Definition: containeritemmodel.cpp:82
virtual size_t getItemCount()
Definition: containeritemmodel.cpp:57
A single item stack managed by an item model.
Definition: itemmodel.hpp:12
std::vector< MWWorld::Ptr > mItemSources
Definition: containeritemmodel.hpp:30
ContainerItemModel(const std::vector< MWWorld::Ptr > &itemSources, const std::vector< MWWorld::Ptr > &worldItems)
Definition: containeritemmodel.cpp:36
virtual void update()
Rebuild the item model, this will invalidate existing model indices.
Definition: containeritemmodel.cpp:118
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
std::vector< MWWorld::Ptr > mWorldItems
Definition: containeritemmodel.hpp:31
virtual ItemStack getItem(ModelIndex index)
Throws for invalid index or out of range index.
Definition: containeritemmodel.cpp:48