OpenMW
Public Member Functions | Private Attributes
MWGui::ContainerItemModel Class Reference

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>

List of all members.

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
virtual ModelIndex getIndex (ItemStack item)
virtual size_t getItemCount ()
virtual void copyItem (const ItemStack &item, size_t count)
virtual void removeItem (const ItemStack &item, size_t count)
virtual void update ()

Private Attributes

std::vector< MWWorld::PtrmItemSources
std::vector< MWWorld::PtrmWorldItems
std::vector< ItemStackmItems

Detailed Description

The container item model supports multiple item sources, which are needed for making NPCs sell items from containers owned by them.


Constructor & Destructor Documentation

MWGui::ContainerItemModel::ContainerItemModel ( const std::vector< MWWorld::Ptr > &  itemSources,
const std::vector< MWWorld::Ptr > &  worldItems 
)
Note:
The order of elements itemSources matters here. The first element has the highest priority for removal, while the last element will be used to add new items to.

Member Function Documentation

void MWGui::ContainerItemModel::copyItem ( const ItemStack item,
size_t  count 
) [virtual]

Implements MWGui::ItemModel.

Implements MWGui::ItemModel.

throws for invalid index

Implements MWGui::ItemModel.

Implements MWGui::ItemModel.

void MWGui::ContainerItemModel::removeItem ( const ItemStack item,
size_t  count 
) [virtual]

Implements MWGui::ItemModel.

Implements MWGui::ItemModel.


Member Data Documentation


The documentation for this class was generated from the following files: