1 #ifndef MWGUI_TRADE_ITEM_MODEL_H
2 #define MWGUI_TRADE_ITEM_MODEL_H
virtual ItemStack getItem(ModelIndex index)
Throws for invalid index or out of range index.
Definition: tradeitemmodel.cpp:18
The base class that all item models should derive from.
Definition: itemmodel.hpp:43
An item model that allows 'borrowing' items from another item model. Used for previewing barter offer...
Definition: tradeitemmodel.hpp:13
void borrowImpl(const ItemStack &item, std::vector< ItemStack > &out)
Definition: tradeitemmodel.cpp:32
A proxy item model can be used to filter or rearrange items from a source model (or even add new item...
Definition: itemmodel.hpp:83
A single item stack managed by an item model.
Definition: itemmodel.hpp:12
void abort()
Aborts trade.
Definition: tradeitemmodel.cpp:111
std::vector< ItemStack > mItems
Definition: tradeitemmodel.hpp:47
std::vector< ItemStack > mBorrowedToUs
Definition: tradeitemmodel.hpp:49
void transferItems()
Permanently transfers items that were borrowed to us from another model to this model.
Definition: tradeitemmodel.cpp:122
virtual void update()
Rebuild the item model, this will invalidate existing model indices.
Definition: tradeitemmodel.cpp:148
MWWorld::Ptr mMerchant
Definition: tradeitemmodel.hpp:52
void borrowItemToUs(ModelIndex itemIndex, ItemModel *source, size_t count)
Definition: tradeitemmodel.cpp:77
virtual size_t getItemCount()
Definition: tradeitemmodel.cpp:27
void returnItemBorrowedToUs(ModelIndex itemIndex, size_t count)
Definition: tradeitemmodel.cpp:84
TradeItemModel(ItemModel *sourceModel, const MWWorld::Ptr &merchant)
Definition: tradeitemmodel.cpp:12
void unborrowImpl(const ItemStack &item, size_t count, std::vector< ItemStack > &out)
Definition: tradeitemmodel.cpp:49
void adjustEncumbrance(float &encumbrance)
Definition: tradeitemmodel.cpp:96
void returnItemBorrowedFromUs(ModelIndex itemIndex, ItemModel *source, size_t count)
Definition: tradeitemmodel.cpp:90
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void borrowItemFromUs(ModelIndex itemIndex, size_t count)
Definition: tradeitemmodel.cpp:70
std::vector< ItemStack > getItemsBorrowedToUs()
Definition: tradeitemmodel.cpp:117
std::vector< ItemStack > mBorrowedFromUs
Definition: tradeitemmodel.hpp:50