1 #ifndef GAME_MWWORLD_INVENTORYSTORE_H
2 #define GAME_MWWORLD_INVENTORYSTORE_H
6 #include "../mwmechanics/magiceffects.hpp"
93 typedef std::vector<ContainerStoreIterator>
TSlots;
178 virtual int remove(
const Ptr& item,
int count,
const Ptr& actor);
218 void purgeEffect (
short effectId,
const std::string& sourceId);
221 virtual void clear();
Definition: magiceffects.hpp:73
Iteration over a subset of objects in a ContainerStore.
Definition: containerstore.hpp:196
static const int Slot_RightPauldron
Definition: inventorystore.hpp:48
static const int Slot_LeftPauldron
Definition: inventorystore.hpp:47
static const int Slot_NoSlot
Definition: inventorystore.hpp:66
virtual void equipmentChanged()
Definition: inventorystore.hpp:26
Used to create pointers to hold any type of LiveCellRef<> object.
Definition: livecellref.hpp:22
std::vector< std::pair< ContainerStoreIterator, float > > TRechargingItems
Definition: inventorystore.hpp:101
static const int Slot_Amulet
Definition: inventorystore.hpp:58
void initSlots(TSlots &slots_)
Definition: inventorystore.cpp:51
Effects currently affecting a NPC or creature.
Definition: magiceffects.hpp:83
TRechargingItems mRechargingItems
Definition: inventorystore.hpp:102
virtual void flagAsModified()
Definition: inventorystore.cpp:604
static const int Slots
Definition: inventorystore.hpp:64
virtual void writeState(ESM::InventoryState &state) const
Definition: inventorystore.cpp:949
static const int Slot_Boots
Definition: inventorystore.hpp:51
static const int Slot_CarriedRight
Definition: inventorystore.hpp:60
static const int Slot_RightRing
Definition: inventorystore.hpp:57
static const int Slot_Ammunition
Definition: inventorystore.hpp:62
ContainerStoreIterator unequipItemQuantity(const Ptr &item, const Ptr &actor, int count)
Definition: inventorystore.cpp:734
TEffectMagnitudes mPermanentMagicEffectMagnitudes
Definition: inventorystore.hpp:91
Definition: inventorystore.hpp:40
void updateRechargingItems()
Definition: inventorystore.cpp:826
static const int Slot_Helmet
Definition: inventorystore.hpp:44
bool mFirstAutoEquip
Definition: inventorystore.hpp:78
Definition: inventorystore.hpp:82
static const int Slot_LeftRing
Definition: inventorystore.hpp:56
TSlots mSlots
Definition: inventorystore.hpp:95
static const int Slot_LeftGauntlet
Definition: inventorystore.hpp:49
const MWMechanics::MagicEffects & getMagicEffects() const
Return magic effects from worn items.
Definition: inventorystore.cpp:486
float mRandom
Definition: inventorystore.hpp:85
virtual void storeEquipmentState(const MWWorld::LiveCellRefBase &ref, int index, ESM::InventoryState &inventory) const
Definition: inventorystore.cpp:57
void autoEquipShield(const MWWorld::Ptr &actor)
Auto-equip the shield with most health.
Definition: inventorystore.cpp:442
std::map< std::string, std::vector< EffectParams > > TEffectMagnitudes
Definition: inventorystore.hpp:90
void rechargeItems(float duration)
Restore charge on enchanted items. Note this should only be done for the player.
Definition: inventorystore.cpp:849
ContainerStoreIterator unequipSlot(int slot, const Ptr &actor)
Definition: inventorystore.cpp:681
static const int Slot_Belt
Definition: inventorystore.hpp:59
void purgeEffect(short effectId)
Remove a magic effect.
Definition: inventorystore.cpp:877
virtual InventoryStore * clone()
Definition: inventorystore.hpp:128
static const int Slot_Cuirass
Definition: inventorystore.hpp:45
InventoryStore & operator=(const InventoryStore &store)
Definition: inventorystore.cpp:123
virtual bool stacks(const ConstPtr &ptr1, const ConstPtr &ptr2)
Definition: inventorystore.cpp:610
Variant of the ContainerStore for NPCs.
Definition: inventorystore.hpp:20
void fireEquipmentChangedEvent(const Ptr &actor)
Definition: inventorystore.cpp:772
ContainerStoreIterator getSelectedEnchantItem()
Definition: inventorystore.cpp:636
virtual void permanentEffectAdded(const ESM::MagicEffect *magicEffect, bool isNew)
Definition: inventorystore.hpp:35
void autoEquip(const MWWorld::Ptr &actor)
Auto equip items according to stats and item value.
Definition: inventorystore.cpp:238
MWMechanics::MagicEffects mMagicEffects
Definition: inventorystore.hpp:70
bool isEquipped(const MWWorld::ConstPtr &item)
Utility function, returns true if the given item is equipped in any slot.
Definition: inventorystore.cpp:939
static const int Slot_RightGauntlet
Definition: inventorystore.hpp:50
InventoryStoreListener * getInvListener()
Definition: inventorystore.cpp:761
ContainerStoreIterator unequipItem(const Ptr &item, const Ptr &actor)
Definition: inventorystore.cpp:722
static const int Slot_Greaves
Definition: inventorystore.hpp:46
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
Definition: loadmgef.hpp:13
State for inventories and containers.
Definition: inventorystate.hpp:16
Definition: containerstore.hpp:41
virtual void readEquipmentState(const MWWorld::ContainerStoreIterator &iter, int index, const ESM::InventoryState &inventory)
Definition: inventorystore.cpp:69
bool mRechargingItemsUpToDate
Definition: inventorystore.hpp:104
ContainerStoreIterator getSlot(int slot)
Definition: inventorystore.cpp:200
std::vector< ContainerStoreIterator > TSlots
Definition: inventorystore.hpp:93
void setInvListener(InventoryStoreListener *listener, const Ptr &actor)
Set a listener for various events, see InventoryStoreListener.
Definition: inventorystore.cpp:766
void equip(int slot, const ContainerStoreIterator &iterator, const Ptr &actor)
Definition: inventorystore.cpp:152
virtual void readState(const ESM::InventoryState &state)
Definition: inventorystore.cpp:965
virtual ContainerStoreIterator add(const Ptr &itemPtr, int count, const Ptr &actorPtr, bool setOwner=false)
Definition: inventorystore.cpp:136
static const int Slot_Skirt
Definition: inventorystore.hpp:54
void setSelectedEnchantItem(const ContainerStoreIterator &iterator)
Definition: inventorystore.cpp:631
InventoryStore()
Definition: inventorystore.cpp:100
static const int Slot_Robe
Definition: inventorystore.hpp:55
void unequipAll(const MWWorld::Ptr &actor)
Unequip all currently equipped items.
Definition: inventorystore.cpp:188
ContainerStoreIterator mSelectedEnchantItem
Definition: inventorystore.hpp:98
InventoryStoreListener * mListener
Definition: inventorystore.hpp:72
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void copySlots(const InventoryStore &store)
Definition: inventorystore.cpp:26
bool canActorAutoEquip(const MWWorld::Ptr &actor, const MWWorld::Ptr &item)
Definition: inventorystore.cpp:218
static const int Slot_Shirt
Definition: inventorystore.hpp:52
float mMultiplier
Definition: inventorystore.hpp:87
virtual void clear()
Empty container.
Definition: inventorystore.cpp:932
void updateMagicEffects(const Ptr &actor)
Definition: inventorystore.cpp:491
void visitEffectSources(MWMechanics::EffectSourceVisitor &visitor)
Definition: inventorystore.cpp:788
static const int Slot_CarriedLeft
Definition: inventorystore.hpp:61
int count(const std::string &id)
Definition: containerstore.cpp:130
bool mUpdatesEnabled
Definition: inventorystore.hpp:76
static const int Slot_Pants
Definition: inventorystore.hpp:53