1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-11 00:39:59 +00:00
OpenMW/apps/openmw/mwworld/refdata.hpp

71 lines
1.6 KiB
C++
Raw Normal View History

2010-07-03 13:41:20 +00:00
#ifndef GAME_MWWORLD_REFDATA_H
#define GAME_MWWORLD_REFDATA_H
2010-07-02 12:00:28 +00:00
#include <string>
2010-07-03 13:41:20 +00:00
#include "../mwscript/locals.hpp"
2010-07-02 12:31:29 +00:00
namespace ESM
{
class Script;
}
2010-07-03 13:41:20 +00:00
namespace MWWorld
{
2010-07-02 12:31:29 +00:00
class RefData
{
2010-07-02 12:31:29 +00:00
std::string mHandle;
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-07-02 12:31:29 +00:00
public:
2010-07-02 15:21:27 +00:00
2010-07-09 14:07:03 +00:00
RefData() : mHasLocals (false), mEnabled (true) {}
2010-07-02 12:31:29 +00:00
std::string getHandle()
{
return mHandle;
}
void setLocals (const ESM::Script& script)
{
2010-07-02 15:21:27 +00:00
if (!mHasLocals)
{
mLocals.configure (script);
mHasLocals = true;
}
2010-07-02 12:31:29 +00:00
}
void setHandle (const std::string& handle)
{
mHandle = handle;
}
MWScript::Locals& getLocals()
{
return mLocals;
}
2010-07-09 14:07:03 +00:00
bool isEnabled() const
{
return mEnabled;
}
void enable()
{
mEnabled = true;
}
void disable()
{
mEnabled = true;
}
2010-07-02 12:31:29 +00:00
};
}
#endif