2010-07-02 12:31:29 +00:00
|
|
|
#ifndef GAME_SCRIPT_LOCALS_H
|
|
|
|
#define GAME_SCRIPT_LOCALS_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <components/interpreter/types.hpp>
|
|
|
|
|
2013-04-04 10:27:57 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Script;
|
2013-12-15 15:16:50 +00:00
|
|
|
struct Locals;
|
2013-04-04 10:27:57 +00:00
|
|
|
}
|
|
|
|
|
2010-07-02 12:31:29 +00:00
|
|
|
namespace MWScript
|
|
|
|
{
|
2013-02-03 13:27:27 +00:00
|
|
|
class Locals
|
2010-07-02 12:31:29 +00:00
|
|
|
{
|
2013-02-03 13:27:27 +00:00
|
|
|
public:
|
|
|
|
std::vector<Interpreter::Type_Short> mShorts;
|
|
|
|
std::vector<Interpreter::Type_Integer> mLongs;
|
|
|
|
std::vector<Interpreter::Type_Float> mFloats;
|
2013-04-04 10:27:57 +00:00
|
|
|
|
2014-06-25 23:21:15 +00:00
|
|
|
/// Are there any locals?
|
|
|
|
bool isEmpty() const;
|
|
|
|
|
2013-02-03 13:27:27 +00:00
|
|
|
void configure (const ESM::Script& script);
|
|
|
|
bool setVarByInt(const std::string& script, const std::string& var, int val);
|
2013-03-31 11:13:46 +00:00
|
|
|
int getIntVar (const std::string& script, const std::string& var); ///< if var does not exist, returns 0
|
2013-04-04 10:27:57 +00:00
|
|
|
|
2013-12-15 15:16:50 +00:00
|
|
|
void write (ESM::Locals& locals, const std::string& script) const;
|
|
|
|
|
|
|
|
void read (const ESM::Locals& locals, const std::string& script);
|
2010-07-02 12:31:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|