-
Notifications
You must be signed in to change notification settings - Fork 0
/
lua.hpp
41 lines (32 loc) · 801 Bytes
/
lua.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LUA_HPP
#define LUA_HPP
#include <Godot.hpp>
#include <Node.hpp>
#include <File.hpp>
#include <map>
extern "C" {
#include "luasrc/lua.h"
#include "luasrc/lauxlib.h"
#include "luasrc/lualib.h"
}
namespace godot {
class LuaScript: public Node {
GODOT_CLASS(LuaScript, Node)
public:
static void _register_methods();
void _init();
LuaScript();
~LuaScript();
bool load(String fileName);
Variant execute(String name, Array array);
bool pushVariant(Variant var);
bool pushGlobalVariant(Variant var, String name);
Variant popVariant();
Variant getVariant(int index = -1);
//lua methods
static int cSum(lua_State* L);
private:
lua_State* L;
};
}
#endif