OpenMW
|
#include <inventorystore.hpp>
Classes | |
struct | EffectParams |
Public Member Functions | |
InventoryStore () | |
InventoryStore (const InventoryStore &store) | |
InventoryStore & | operator= (const InventoryStore &store) |
virtual InventoryStore * | clone () |
virtual ContainerStoreIterator | add (const Ptr &itemPtr, int count, const Ptr &actorPtr, bool setOwner=false) |
void | equip (int slot, const ContainerStoreIterator &iterator, const Ptr &actor) |
bool | isEquipped (const MWWorld::ConstPtr &item) |
Utility function, returns true if the given item is equipped in any slot. More... | |
void | setSelectedEnchantItem (const ContainerStoreIterator &iterator) |
ContainerStoreIterator | getSelectedEnchantItem () |
ContainerStoreIterator | getSlot (int slot) |
void | unequipAll (const MWWorld::Ptr &actor) |
Unequip all currently equipped items. More... | |
void | autoEquip (const MWWorld::Ptr &actor) |
Auto equip items according to stats and item value. More... | |
void | autoEquipShield (const MWWorld::Ptr &actor) |
Auto-equip the shield with most health. More... | |
const MWMechanics::MagicEffects & | getMagicEffects () const |
Return magic effects from worn items. More... | |
virtual void | flagAsModified () |
virtual bool | stacks (const ConstPtr &ptr1, const ConstPtr &ptr2) |
virtual int | remove (const Ptr &item, int count, const Ptr &actor) |
ContainerStoreIterator | unequipSlot (int slot, const Ptr &actor) |
ContainerStoreIterator | unequipItem (const Ptr &item, const Ptr &actor) |
ContainerStoreIterator | unequipItemQuantity (const Ptr &item, const Ptr &actor, int count) |
void | setInvListener (InventoryStoreListener *listener, const Ptr &actor) |
Set a listener for various events, see InventoryStoreListener. More... | |
InventoryStoreListener * | getInvListener () |
void | visitEffectSources (MWMechanics::EffectSourceVisitor &visitor) |
void | rechargeItems (float duration) |
Restore charge on enchanted items. Note this should only be done for the player. More... | |
void | purgeEffect (short effectId) |
Remove a magic effect. More... | |
void | purgeEffect (short effectId, const std::string &sourceId) |
Remove a magic effect. More... | |
virtual void | clear () |
Empty container. More... | |
virtual void | writeState (ESM::InventoryState &state) const |
virtual void | readState (const ESM::InventoryState &state) |
Public Member Functions inherited from MWWorld::ContainerStore | |
ContainerStore () | |
virtual | ~ContainerStore () |
ContainerStoreIterator | begin (int mask=Type_All) |
ContainerStoreIterator | end () |
ContainerStoreIterator | add (const std::string &id, int count, const Ptr &actorPtr) |
Utility to construct a ManualRef and call add(ptr, count, actorPtr, true) More... | |
int | remove (const std::string &itemId, int count, const Ptr &actor) |
ContainerStoreIterator | unstack (const Ptr &ptr, const Ptr &container, int count=1) |
MWWorld::ContainerStoreIterator | restack (const MWWorld::Ptr &item) |
int | count (const std::string &id) |
ContainerStoreListener * | getContListener () const |
void | setContListener (ContainerStoreListener *listener) |
void | fill (const ESM::InventoryList &items, const std::string &owner) |
Insert items into *this. More... | |
void | restock (const ESM::InventoryList &items, const MWWorld::Ptr &ptr, const std::string &owner) |
float | getWeight () const |
Return total weight of the items contained in *this. More... | |
Ptr | search (const std::string &id) |
template<typename T > | |
MWWorld::ContainerStoreIterator | getState (CellRefList< T > &collection, const ESM::ObjectState &state) |
Static Public Attributes | |
static const int | Slot_Helmet = 0 |
static const int | Slot_Cuirass = 1 |
static const int | Slot_Greaves = 2 |
static const int | Slot_LeftPauldron = 3 |
static const int | Slot_RightPauldron = 4 |
static const int | Slot_LeftGauntlet = 5 |
static const int | Slot_RightGauntlet = 6 |
static const int | Slot_Boots = 7 |
static const int | Slot_Shirt = 8 |
static const int | Slot_Pants = 9 |
static const int | Slot_Skirt = 10 |
static const int | Slot_Robe = 11 |
static const int | Slot_LeftRing = 12 |
static const int | Slot_RightRing = 13 |
static const int | Slot_Amulet = 14 |
static const int | Slot_Belt = 15 |
static const int | Slot_CarriedRight = 16 |
static const int | Slot_CarriedLeft = 17 |
static const int | Slot_Ammunition = 18 |
static const int | Slots = 19 |
static const int | Slot_NoSlot = -1 |
Static Public Attributes inherited from MWWorld::ContainerStore | |
static const int | Type_Potion = 0x0001 |
static const int | Type_Apparatus = 0x0002 |
static const int | Type_Armor = 0x0004 |
static const int | Type_Book = 0x0008 |
static const int | Type_Clothing = 0x0010 |
static const int | Type_Ingredient = 0x0020 |
static const int | Type_Light = 0x0040 |
static const int | Type_Lockpick = 0x0080 |
static const int | Type_Miscellaneous = 0x0100 |
static const int | Type_Probe = 0x0200 |
static const int | Type_Repair = 0x0400 |
static const int | Type_Weapon = 0x0800 |
static const int | Type_Last = Type_Weapon |
static const int | Type_All = 0xffff |
static const std::string | sGoldId = "gold_001" |
Private Types | |
typedef std::map< std::string, std::vector< EffectParams > > | TEffectMagnitudes |
typedef std::vector < ContainerStoreIterator > | TSlots |
typedef std::vector< std::pair < ContainerStoreIterator, float > > | TRechargingItems |
Private Member Functions | |
void | copySlots (const InventoryStore &store) |
void | initSlots (TSlots &slots_) |
void | updateMagicEffects (const Ptr &actor) |
void | updateRechargingItems () |
void | fireEquipmentChangedEvent (const Ptr &actor) |
virtual void | storeEquipmentState (const MWWorld::LiveCellRefBase &ref, int index, ESM::InventoryState &inventory) const |
virtual void | readEquipmentState (const MWWorld::ContainerStoreIterator &iter, int index, const ESM::InventoryState &inventory) |
bool | canActorAutoEquip (const MWWorld::Ptr &actor, const MWWorld::Ptr &item) |
Additional Inherited Members | |
Static Public Member Functions inherited from MWWorld::ContainerStore | |
static int | getType (const ConstPtr &ptr) |
Protected Member Functions inherited from MWWorld::ContainerStore | |
ContainerStoreIterator | addNewStack (const ConstPtr &ptr, int count) |
Add the item to this container (do not try to stack it onto existing items) More... | |
|
private |
|
private |
|
private |
MWWorld::InventoryStore::InventoryStore | ( | ) |
MWWorld::InventoryStore::InventoryStore | ( | const InventoryStore & | store | ) |
|
virtual |
Add the item pointed to by ptr to this container. (Stacks automatically if needed) Auto-equip items if specific conditions are fulfilled (see the implementation).
setOwner | Set the owner of the added item to actorPtr? |
Reimplemented from MWWorld::ContainerStore.
void MWWorld::InventoryStore::autoEquip | ( | const MWWorld::Ptr & | actor | ) |
Auto equip items according to stats and item value.
void MWWorld::InventoryStore::autoEquipShield | ( | const MWWorld::Ptr & | actor | ) |
Auto-equip the shield with most health.
|
private |
|
virtual |
Empty container.
Reimplemented from MWWorld::ContainerStore.
|
inlinevirtual |
|
private |
void MWWorld::InventoryStore::equip | ( | int | slot, |
const ContainerStoreIterator & | iterator, | ||
const Ptr & | actor | ||
) |
|
private |
|
virtual |
Reimplemented from MWWorld::ContainerStore.
MWWorld::InventoryStoreListener * MWWorld::InventoryStore::getInvListener | ( | ) |
const MWMechanics::MagicEffects & MWWorld::InventoryStore::getMagicEffects | ( | ) | const |
Return magic effects from worn items.
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::getSelectedEnchantItem | ( | ) |
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::getSlot | ( | int | slot | ) |
|
private |
bool MWWorld::InventoryStore::isEquipped | ( | const MWWorld::ConstPtr & | item | ) |
Utility function, returns true if the given item is equipped in any slot.
MWWorld::InventoryStore & MWWorld::InventoryStore::operator= | ( | const InventoryStore & | store | ) |
void MWWorld::InventoryStore::purgeEffect | ( | short | effectId | ) |
Remove a magic effect.
void MWWorld::InventoryStore::purgeEffect | ( | short | effectId, |
const std::string & | sourceId | ||
) |
Remove a magic effect.
|
privatevirtual |
|
virtual |
Reimplemented from MWWorld::ContainerStore.
void MWWorld::InventoryStore::rechargeItems | ( | float | duration | ) |
Restore charge on enchanted items. Note this should only be done for the player.
Remove count item(s) designated by item from this inventory.
Reimplemented from MWWorld::ContainerStore.
void MWWorld::InventoryStore::setInvListener | ( | InventoryStoreListener * | listener, |
const Ptr & | actor | ||
) |
Set a listener for various events, see InventoryStoreListener.
void MWWorld::InventoryStore::setSelectedEnchantItem | ( | const ContainerStoreIterator & | iterator | ) |
set the selected magic item (for using enchantments of type "Cast once" or "Cast when used")
Reimplemented from MWWorld::ContainerStore.
|
privatevirtual |
Reimplemented from MWWorld::ContainerStore.
void MWWorld::InventoryStore::unequipAll | ( | const MWWorld::Ptr & | actor | ) |
Unequip all currently equipped items.
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipItem | ( | const Ptr & | item, |
const Ptr & | actor | ||
) |
Unequip an item identified by its Ptr. An exception is thrown if the item is not currently equipped.
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipItemQuantity | ( | const Ptr & | item, |
const Ptr & | actor, | ||
int | count | ||
) |
Unequip a specific quantity of an item identified by its Ptr. An exception is thrown if the item is not currently equipped, if count <= 0, or if count > the item stack size.
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot | ( | int | slot, |
const Ptr & | actor | ||
) |
Unequip slot.
|
private |
|
private |
void MWWorld::InventoryStore::visitEffectSources | ( | MWMechanics::EffectSourceVisitor & | visitor | ) |
|
virtual |
Reimplemented from MWWorld::ContainerStore.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |