2014-01-31 12:25:32 +00:00
|
|
|
#ifndef OPENMW_ESM_INVENTORYSTATE_H
|
|
|
|
#define OPENMW_ESM_INVENTORYSTATE_H
|
|
|
|
|
2014-05-18 10:53:21 +00:00
|
|
|
#include <map>
|
|
|
|
|
2014-01-31 12:25:32 +00:00
|
|
|
#include "objectstate.hpp"
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
|
|
|
// format 0, saved games only
|
|
|
|
|
|
|
|
/// \brief State for inventories and containers
|
|
|
|
struct InventoryState
|
|
|
|
{
|
2015-01-23 15:45:47 +00:00
|
|
|
std::vector<ObjectState> mItems;
|
|
|
|
|
|
|
|
// <Index in mItems, equipment slot>
|
|
|
|
std::map<int, int> mEquipmentSlots;
|
2014-01-31 12:25:32 +00:00
|
|
|
|
2015-12-09 17:24:35 +00:00
|
|
|
std::map<std::pair<std::string, std::string>, int> mLevelledItemMap;
|
2014-05-18 10:53:21 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
typedef std::map<std::string, std::vector<std::pair<float, float>>> TEffectMagnitudes;
|
2014-12-30 00:36:31 +00:00
|
|
|
TEffectMagnitudes mPermanentMagicEffectMagnitudes;
|
|
|
|
|
2015-01-23 15:45:47 +00:00
|
|
|
int mSelectedEnchantItem; // For inventories only
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
InventoryState()
|
|
|
|
: mSelectedEnchantItem(-1)
|
|
|
|
{
|
|
|
|
}
|
2014-05-15 01:12:52 +00:00
|
|
|
virtual ~InventoryState() {}
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
virtual void load(ESMReader& esm);
|
|
|
|
virtual void save(ESMWriter& esm) const;
|
2014-01-31 12:25:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|