blob: 1c18620ce701635d843c1c6a0d35030a7cf87540 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#pragma once
#include "./LuaBind/LuaBind.h"
// lua 5.1 doc: https://www.lua.org/manual/5.1/
// 针对GameLab做一些扩展
class LuaHelper
{
public:
static int Call(const char* func, const char* params, ...);
static bool IsType(LuaBind::State& state, const char* typeName, int idx);
static void OnRegisterNativeClass(LuaBind::State& state, int cls, std::string clsName, std::string pkgName);
// 创建lua类的实例并留在栈顶,如果失败返回false且不压栈
static bool InstantiateClass(LuaBind::State& state, const char* classFullName);
// 找到类table,并留在栈顶,如果返回false表示没有找到,栈顶无值
static bool GetLuaClass(LuaBind::State& state, const char* fullName);
// 找到全局表下的数据
static bool GetGlobalField(LuaBind::State& state, const char* fullName);
};
|