diff options
Diffstat (limited to 'Runtime/Lua/LuaBind/LuaBindLFunction.h')
-rw-r--r-- | Runtime/Lua/LuaBind/LuaBindLFunction.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/Runtime/Lua/LuaBind/LuaBindLFunction.h b/Runtime/Lua/LuaBind/LuaBindLFunction.h index 1ad6fa0..5c4346b 100644 --- a/Runtime/Lua/LuaBind/LuaBindLFunction.h +++ b/Runtime/Lua/LuaBind/LuaBindLFunction.h @@ -3,19 +3,29 @@ namespace LuaBind
{
- struct LuaFunction : public GlobalInvoker
+ struct LuaFunction
{
const char* method; // full name
- LuaFunction(lua_State* L, const char* func)
- : GlobalInvoker(L)
- , method(func)
- {}
+ LuaFunction(const char* func=NULL);
+ void operator = (const char* func);
- void Invoke(int nReturns) override
- {
+ void AddInt(State& state, int n);
+ void AddFloat(State& state, float n);
+ void AddNil(State& state);
+ void AddBool(State& state, bool b);
+ void AddString(State& state, const char* str);
+ void AddTable(State& state, INativeTable& tb);
+ template<class T>
+ void AddUserdata(State& state, NativeClass<T>& udata) {
+ udata.PushUserdata(state);
+ ++argc;
+ }
- }
+ void Invoke(State& state, int nReturns);
+
+ private:
+ int argc;
};
}
\ No newline at end of file |