OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
MWGui::PickpocketItemModel Class Reference

The pickpocket item model randomly hides item stacks based on a specified chance. Equipped items are always hidden. More...

#include <pickpocketitemmodel.hpp>

Inheritance diagram for MWGui::PickpocketItemModel:
Collaboration diagram for MWGui::PickpocketItemModel:

Public Member Functions

 PickpocketItemModel (const MWWorld::Ptr &thief, ItemModel *sourceModel, bool hideItems=true)
 
virtual bool allowedToUseItems () const
 Is the player allowed to use items from this item model? (default true) More...
 
virtual ItemStack getItem (ModelIndex index)
 Throws for invalid index or out of range index. More...
 
virtual size_t getItemCount ()
 
virtual void update ()
 Rebuild the item model, this will invalidate existing model indices. More...
 
virtual void removeItem (const ItemStack &item, size_t count)
 
virtual void onClose ()
 
virtual bool onDropItem (const MWWorld::Ptr &item, int count)
 
virtual bool onTakeItem (const MWWorld::Ptr &item, int count)
 
- Public Member Functions inherited from MWGui::ProxyItemModel
 ProxyItemModel ()
 
virtual ~ProxyItemModel ()
 
virtual MWWorld::Ptr copyItem (const ItemStack &item, size_t count, bool setNewOwner=false)
 
virtual ModelIndex getIndex (ItemStack item)
 Returns an invalid index if the item was not found. More...
 
void setSourceModel (ItemModel *sourceModel)
 
ModelIndex mapToSource (ModelIndex index)
 
ModelIndex mapFromSource (ModelIndex index)
 
- Public Member Functions inherited from MWGui::ItemModel
 ItemModel ()
 
virtual ~ItemModel ()
 
virtual MWWorld::Ptr moveItem (const ItemStack &item, size_t count, ItemModel *otherModel)
 

Protected Member Functions

bool stealItem (const MWWorld::Ptr &item, int count)
 

Protected Attributes

MWWorld::Ptr mActor
 
bool mPickpocketDetected
 
- Protected Attributes inherited from MWGui::ProxyItemModel
ItemModelmSourceModel
 

Private Attributes

std::vector< ItemStackmHiddenItems
 
std::vector< ItemStackmItems
 

Additional Inherited Members

- Public Types inherited from MWGui::ItemModel
typedef int ModelIndex
 

Detailed Description

The pickpocket item model randomly hides item stacks based on a specified chance. Equipped items are always hidden.

Constructor & Destructor Documentation

MWGui::PickpocketItemModel::PickpocketItemModel ( const MWWorld::Ptr thief,
ItemModel sourceModel,
bool  hideItems = true 
)

Here is the call graph for this function:

Member Function Documentation

bool MWGui::PickpocketItemModel::allowedToUseItems ( ) const
virtual

Is the player allowed to use items from this item model? (default true)

Reimplemented from MWGui::ProxyItemModel.

ItemStack MWGui::PickpocketItemModel::getItem ( ModelIndex  index)
virtual

Throws for invalid index or out of range index.

Implements MWGui::ItemModel.

size_t MWGui::PickpocketItemModel::getItemCount ( )
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.

void MWGui::PickpocketItemModel::onClose ( )
virtual

Reimplemented from MWGui::ProxyItemModel.

Here is the call graph for this function:

bool MWGui::PickpocketItemModel::onDropItem ( const MWWorld::Ptr item,
int  count 
)
virtual

Reimplemented from MWGui::ProxyItemModel.

bool MWGui::PickpocketItemModel::onTakeItem ( const MWWorld::Ptr item,
int  count 
)
virtual

Reimplemented from MWGui::ProxyItemModel.

Here is the call graph for this function:

void MWGui::PickpocketItemModel::removeItem ( const ItemStack item,
size_t  count 
)
virtual

Reimplemented from MWGui::ProxyItemModel.

Here is the call graph for this function:

bool MWGui::PickpocketItemModel::stealItem ( const MWWorld::Ptr item,
int  count 
)
protected

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::PickpocketItemModel::update ( )
virtual

Rebuild the item model, this will invalidate existing model indices.

Implements MWGui::ItemModel.

Here is the call graph for this function:

Member Data Documentation

MWWorld::Ptr MWGui::PickpocketItemModel::mActor
protected
std::vector<ItemStack> MWGui::PickpocketItemModel::mHiddenItems
private
std::vector<ItemStack> MWGui::PickpocketItemModel::mItems
private
bool MWGui::PickpocketItemModel::mPickpocketDetected
protected

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