mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-11 00:39:59 +00:00
89d9649b50
Store the index for the allowedSlots vector instead of the absolute slot index. This will more gracefully handle edge cases like the available slots for an item having changed when loading the game, or the "allows stacking" property having changed. However the main reason this was done is to ease work on the essimporter.
34 lines
765 B
C++
34 lines
765 B
C++
#ifndef OPENMW_ESM_INVENTORYSTATE_H
|
|
#define OPENMW_ESM_INVENTORYSTATE_H
|
|
|
|
#include <map>
|
|
|
|
#include "objectstate.hpp"
|
|
|
|
namespace ESM
|
|
{
|
|
class ESMReader;
|
|
class ESMWriter;
|
|
|
|
// format 0, saved games only
|
|
|
|
/// \brief State for inventories and containers
|
|
struct InventoryState
|
|
{
|
|
/// <ObjectState, relative equipment slot>
|
|
std::vector<std::pair<ObjectState, int> > mItems;
|
|
|
|
std::map<std::string, int> mLevelledItemMap;
|
|
|
|
typedef std::map<std::string, std::vector<std::pair<float, float> > > TEffectMagnitudes;
|
|
TEffectMagnitudes mPermanentMagicEffectMagnitudes;
|
|
|
|
virtual ~InventoryState() {}
|
|
|
|
virtual void load (ESMReader &esm);
|
|
virtual void save (ESMWriter &esm) const;
|
|
};
|
|
}
|
|
|
|
#endif
|