2010-07-02 14:18:25 +00:00
|
|
|
#ifndef GAME_SCRIPT_SCRIPTMANAGER_H
|
|
|
|
#define GAME_SCRIPT_SCRIPTMANAGER_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2010-07-02 15:21:27 +00:00
|
|
|
#include <components/compiler/streamerrorhandler.hpp>
|
|
|
|
#include <components/compiler/fileparser.hpp>
|
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
#include <components/interpreter/types.hpp>
|
|
|
|
|
|
|
|
namespace ESMS
|
|
|
|
{
|
|
|
|
struct ESMStore;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Compiler
|
|
|
|
{
|
|
|
|
class Context;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Interpreter
|
|
|
|
{
|
|
|
|
class Context;
|
2010-07-03 10:12:13 +00:00
|
|
|
class Interpreter;
|
2010-07-02 14:18:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWScript
|
2010-07-02 16:08:00 +00:00
|
|
|
{
|
2010-07-02 14:18:25 +00:00
|
|
|
class ScriptManager
|
|
|
|
{
|
2010-07-02 15:21:27 +00:00
|
|
|
Compiler::StreamErrorHandler mErrorHandler;
|
2010-07-02 14:18:25 +00:00
|
|
|
const ESMS::ESMStore& mStore;
|
|
|
|
bool mVerbose;
|
2010-07-02 15:21:27 +00:00
|
|
|
Compiler::Context& mCompilerContext;
|
|
|
|
Compiler::FileParser mParser;
|
2010-07-02 14:18:25 +00:00
|
|
|
|
|
|
|
std::map<std::string, std::vector<Interpreter::Type_Code> > mScripts;
|
|
|
|
|
2010-07-02 15:21:27 +00:00
|
|
|
bool compile (const std::string& name);
|
|
|
|
|
2010-07-02 14:18:25 +00:00
|
|
|
public:
|
|
|
|
|
2010-07-02 15:21:27 +00:00
|
|
|
ScriptManager (const ESMS::ESMStore& store, bool verbose,
|
|
|
|
Compiler::Context& compilerContext);
|
2010-07-02 14:18:25 +00:00
|
|
|
|
2010-07-02 16:08:00 +00:00
|
|
|
void run (const std::string& name, Interpreter::Context& interpreterContext);
|
2010-07-02 14:18:25 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|