OpenMW
|
The container item model supports multiple item sources, which are needed for making NPCs sell items from containers owned by them. More...
#include <containeritemmodel.hpp>
Public Member Functions | |
ContainerItemModel (const std::vector< MWWorld::Ptr > &itemSources, const std::vector< MWWorld::Ptr > &worldItems) | |
ContainerItemModel (const MWWorld::Ptr &source) | |
virtual ItemStack | getItem (ModelIndex index) |
Throws for invalid index or out of range index. More... | |
virtual ModelIndex | getIndex (ItemStack item) |
Returns an invalid index if the item was not found. More... | |
virtual size_t | getItemCount () |
virtual MWWorld::Ptr | copyItem (const ItemStack &item, size_t count, bool setNewOwner=false) |
virtual void | removeItem (const ItemStack &item, size_t count) |
virtual void | update () |
Rebuild the item model, this will invalidate existing model indices. More... | |
Public Member Functions inherited from MWGui::ItemModel | |
ItemModel () | |
virtual | ~ItemModel () |
virtual MWWorld::Ptr | moveItem (const ItemStack &item, size_t count, ItemModel *otherModel) |
virtual bool | allowedToInsertItems () const |
Is the player allowed to insert items into this model? (default true) More... | |
Private Attributes | |
std::vector< MWWorld::Ptr > | mItemSources |
std::vector< MWWorld::Ptr > | mWorldItems |
std::vector< ItemStack > | mItems |
Additional Inherited Members | |
Public Types inherited from MWGui::ItemModel | |
typedef int | ModelIndex |
The container item model supports multiple item sources, which are needed for making NPCs sell items from containers owned by them.
MWGui::ContainerItemModel::ContainerItemModel | ( | const std::vector< MWWorld::Ptr > & | itemSources, |
const std::vector< MWWorld::Ptr > & | worldItems | ||
) |
MWGui::ContainerItemModel::ContainerItemModel | ( | const MWWorld::Ptr & | source | ) |
|
virtual |
setNewOwner | If true, set the copied item's owner to the actor we are copying to, otherwise reset owner to "" |
Implements MWGui::ItemModel.
|
virtual |
Returns an invalid index if the item was not found.
Implements MWGui::ItemModel.
|
virtual |
Throws for invalid index or out of range index.
Implements MWGui::ItemModel.
|
virtual |
The number of items in the model, this specifies the range of indices you can pass to the getItem function (but this range is only valid until the next call to update())
Implements MWGui::ItemModel.
|
virtual |
|
virtual |
Rebuild the item model, this will invalidate existing model indices.
Implements MWGui::ItemModel.
|
private |
|
private |
|
private |