1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:49:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/pickpocketitemmodel.hpp

37 lines
1.1 KiB
C++
Raw Normal View History

2013-05-11 16:38:27 +00:00
#ifndef MWGUI_PICKPOCKET_ITEM_MODEL_H
#define MWGUI_PICKPOCKET_ITEM_MODEL_H
#include "itemmodel.hpp"
namespace MWGui
{
/// @brief The pickpocket item model randomly hides item stacks based on a specified chance. Equipped items are always hidden.
class PickpocketItemModel : public ProxyItemModel
{
public:
PickpocketItemModel (const MWWorld::Ptr& thief, ItemModel* sourceModel, bool hideItems=true);
bool allowedToUseItems() const override;
ItemStack getItem (ModelIndex index) override;
size_t getItemCount() override;
void update() override;
void removeItem (const ItemStack& item, size_t count) override;
void onClose() override;
bool onDropItem(const MWWorld::Ptr &item, int count) override;
bool onTakeItem(const MWWorld::Ptr &item, int count) override;
2017-10-04 17:25:22 +00:00
protected:
MWWorld::Ptr mActor;
2017-10-04 19:26:06 +00:00
bool mPickpocketDetected;
bool stealItem(const MWWorld::Ptr &item, int count);
2013-05-11 16:38:27 +00:00
private:
std::vector<ItemStack> mHiddenItems;
std::vector<ItemStack> mItems;
};
}
#endif