1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 19:19:55 +00:00
openmw-tes3mp/apps/openmw/refdata.hpp

55 lines
1.2 KiB
C++
Raw Normal View History

#ifndef REFDATA_H
#define REFDATA_H
2010-07-02 12:00:28 +00:00
#include <string>
2010-07-02 12:31:29 +00:00
#include "mwscript/locals.hpp"
namespace ESM
{
class Script;
}
namespace OMW
{
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-02 12:31:29 +00:00
public:
2010-07-02 15:21:27 +00:00
RefData() : mHasLocals (false) {}
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;
}
};
}
#endif