OpenGTA/lua_addon/lua_vm.h
Anonymous Maarten 78c27f03c8 2006-12-10
2015-12-03 01:37:02 +01:00

35 lines
931 B
C++

#ifndef OPENGTA_SCRIPT_VM_H
#define OPENGTA_SCRIPT_VM_H
#include "lua.hpp"
#include "Singleton.h"
#include "gl_cityview.h"
namespace OpenGTA {
namespace Script {
class LuaVM {
public:
LuaVM();
~LuaVM();
void runString(const char*);
void runFile(const char*);
void callSimpleFunction(const char*);
void prepare();
void setCityView(OpenGTA::CityView &);
int getGlobalInt(const char*);
float getGlobalFloat(const char*);
const char* getGlobalString(const char*);
void setGlobalInt(const char*, int);
void setGlobalFloat(const char*, float);
void setGlobalString(const char*, const char*);
protected:
lua_State *L;
private:
bool _registered;
};
typedef Loki::SingletonHolder<LuaVM, Loki::CreateUsingNew, Loki::DefaultLifetime,
Loki::SingleThreaded> LuaVMHolder;
}
}
#endif