2010-07-03 13:41:20 +00:00
|
|
|
#ifndef GAME_MWWORLD_REFDATA_H
|
|
|
|
#define GAME_MWWORLD_REFDATA_H
|
2010-07-02 11:48:48 +00:00
|
|
|
|
2012-01-27 13:55:58 +00:00
|
|
|
#include <components/esm/defs.hpp>
|
2010-07-02 12:31:29 +00:00
|
|
|
|
2012-01-27 13:55:58 +00:00
|
|
|
#include "../mwscript/locals.hpp"
|
2010-08-04 12:37:23 +00:00
|
|
|
|
2012-07-03 13:32:38 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class SceneNode;
|
|
|
|
}
|
|
|
|
|
2010-07-02 12:31:29 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class Script;
|
2012-01-27 13:55:58 +00:00
|
|
|
class CellRef;
|
2010-07-02 12:31:29 +00:00
|
|
|
}
|
|
|
|
|
2010-07-03 13:41:20 +00:00
|
|
|
namespace MWWorld
|
2010-07-02 11:48:48 +00:00
|
|
|
{
|
2012-01-24 10:23:22 +00:00
|
|
|
class CustomData;
|
|
|
|
|
2010-07-02 12:31:29 +00:00
|
|
|
class RefData
|
2010-07-02 11:48:48 +00:00
|
|
|
{
|
2011-10-30 21:31:49 +00:00
|
|
|
Ogre::SceneNode* mBaseNode;
|
2011-10-30 20:59:40 +00:00
|
|
|
|
2010-08-04 12:04:22 +00:00
|
|
|
|
2010-07-02 12:31:29 +00:00
|
|
|
MWScript::Locals mLocals; // if we find the overhead of heaving a locals
|
|
|
|
// object in the refdata of refs without a script,
|
|
|
|
// we can make this a pointer later.
|
2010-07-02 15:21:27 +00:00
|
|
|
bool mHasLocals;
|
2010-07-09 14:07:03 +00:00
|
|
|
bool mEnabled;
|
2010-08-04 12:04:22 +00:00
|
|
|
int mCount; // 0: deleted
|
|
|
|
|
2012-01-22 10:20:05 +00:00
|
|
|
ESM::Position mPosition;
|
|
|
|
|
2012-01-24 10:23:22 +00:00
|
|
|
CustomData *mCustomData;
|
|
|
|
|
2012-01-22 10:20:05 +00:00
|
|
|
void copy (const RefData& refData);
|
|
|
|
|
|
|
|
void cleanup();
|
2010-08-04 12:04:22 +00:00
|
|
|
|
2011-11-08 00:08:00 +00:00
|
|
|
public:
|
2012-01-22 10:00:40 +00:00
|
|
|
|
|
|
|
/// @param cellRef Used to copy constant data such as position into this class where it can
|
|
|
|
/// be altered without effecting the original data. This makes it possible
|
|
|
|
/// to reset the position as the orignal data is still held in the CellRef
|
2012-01-27 13:55:58 +00:00
|
|
|
RefData (const ESM::CellRef& cellRef);
|
2012-01-22 10:00:40 +00:00
|
|
|
|
2012-01-22 10:20:05 +00:00
|
|
|
RefData (const RefData& refData);
|
|
|
|
|
|
|
|
~RefData();
|
|
|
|
|
|
|
|
RefData& operator= (const RefData& refData);
|
|
|
|
|
2012-01-22 10:00:40 +00:00
|
|
|
/// Return OGRE handle (may be empty).
|
|
|
|
std::string getHandle();
|
|
|
|
|
|
|
|
/// Return OGRE base node (can be a null pointer).
|
|
|
|
Ogre::SceneNode* getBaseNode();
|
|
|
|
|
|
|
|
/// Set OGRE base node (can be a null pointer).
|
|
|
|
void setBaseNode (Ogre::SceneNode* base);
|
|
|
|
|
|
|
|
int getCount() const;
|
|
|
|
|
|
|
|
void setLocals (const ESM::Script& script);
|
|
|
|
|
|
|
|
void setCount (int count);
|
|
|
|
|
|
|
|
MWScript::Locals& getLocals();
|
|
|
|
|
|
|
|
bool isEnabled() const;
|
|
|
|
|
|
|
|
void enable();
|
|
|
|
|
|
|
|
void disable();
|
|
|
|
|
|
|
|
ESM::Position& getPosition();
|
2012-01-24 10:23:22 +00:00
|
|
|
|
|
|
|
void setCustomData (CustomData *data);
|
|
|
|
///< Set custom data (potentially replacing old custom data). The ownership of \æ data is
|
|
|
|
/// transferred to this.
|
|
|
|
|
|
|
|
CustomData *getCustomData();
|
|
|
|
///< May return a 0-pointer. The ownership of the return data object is not transferred.
|
2010-08-04 12:04:22 +00:00
|
|
|
};
|
2010-07-02 11:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|