2014-01-14 11:25:35 +00:00
|
|
|
#ifndef OPENMW_ESM_OBJECTSTATE_H
|
|
|
|
#define OPENMW_ESM_OBJECTSTATE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "cellref.hpp"
|
|
|
|
#include "locals.hpp"
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
|
|
|
// format 0, saved games only
|
|
|
|
|
|
|
|
///< \brief Save state for objects, that do not use custom data
|
|
|
|
struct ObjectState
|
|
|
|
{
|
|
|
|
CellRef mRef;
|
|
|
|
|
|
|
|
unsigned char mHasLocals;
|
|
|
|
Locals mLocals;
|
|
|
|
unsigned char mEnabled;
|
|
|
|
int mCount;
|
|
|
|
ESM::Position mPosition;
|
|
|
|
float mLocalRotation[3];
|
|
|
|
|
2015-01-19 22:29:06 +00:00
|
|
|
// Is there any class-specific state following the ObjectState
|
|
|
|
bool mHasCustomState;
|
|
|
|
|
2015-06-30 01:58:23 +00:00
|
|
|
unsigned int mVersion;
|
|
|
|
|
|
|
|
ObjectState() : mHasCustomState(true), mVersion(0)
|
2015-01-19 22:29:06 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
/// @note Does not load the CellRef ID, it should already be loaded before calling this method
|
2014-01-28 12:53:24 +00:00
|
|
|
virtual void load (ESMReader &esm);
|
2015-01-19 22:29:06 +00:00
|
|
|
|
2014-01-28 12:53:24 +00:00
|
|
|
virtual void save (ESMWriter &esm, bool inInventory = false) const;
|
|
|
|
|
2015-01-18 18:59:29 +00:00
|
|
|
/// Initialize to default state
|
|
|
|
void blank();
|
|
|
|
|
2014-01-28 12:53:24 +00:00
|
|
|
virtual ~ObjectState();
|
2014-01-14 11:25:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-01-18 18:59:29 +00:00
|
|
|
#endif
|