static int _CreateEventSystem_EventDispatcher(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { EventSystem.EventDispatcher obj = new EventSystem.EventDispatcher(); ToLua.PushObject(L, obj); return(1); } else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(object))) { object arg0 = ToLua.ToVarObject(L, 1); EventSystem.EventDispatcher obj = new EventSystem.EventDispatcher(arg0); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: EventSystem.EventDispatcher.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveEventListener(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.CheckObject(L, 1, typeof(EventSystem.EventDispatcher)); string arg0 = ToLua.CheckString(L, 2); EventSystem.EventDelegate arg1 = null; LuaTypes funcType3 = LuaDLL.lua_type(L, 3); if (funcType3 != LuaTypes.LUA_TFUNCTION) { arg1 = (EventSystem.EventDelegate)ToLua.CheckObject(L, 3, typeof(EventSystem.EventDelegate)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 3); arg1 = DelegateFactory.CreateDelegate(typeof(EventSystem.EventDelegate), func) as EventSystem.EventDelegate; } bool o = obj.RemoveEventListener(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int AddEventListener(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(EventSystem.EventDispatcher), typeof(string), typeof(EventSystem.EventDelegate))) { EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.ToObject(L, 1); string arg0 = ToLua.ToString(L, 2); EventSystem.EventDelegate arg1 = null; LuaTypes funcType3 = LuaDLL.lua_type(L, 3); if (funcType3 != LuaTypes.LUA_TFUNCTION) { arg1 = (EventSystem.EventDelegate)ToLua.ToObject(L, 3); } else { LuaFunction func = ToLua.ToLuaFunction(L, 3); arg1 = DelegateFactory.CreateDelegate(typeof(EventSystem.EventDelegate), func) as EventSystem.EventDelegate; } bool o = obj.AddEventListener(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(EventSystem.EventDispatcher), typeof(string), typeof(EventSystem.EventDelegate), typeof(EventSystem.EventDispatcherAddMode))) { EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.ToObject(L, 1); string arg0 = ToLua.ToString(L, 2); EventSystem.EventDelegate arg1 = null; LuaTypes funcType3 = LuaDLL.lua_type(L, 3); if (funcType3 != LuaTypes.LUA_TFUNCTION) { arg1 = (EventSystem.EventDelegate)ToLua.ToObject(L, 3); } else { LuaFunction func = ToLua.ToLuaFunction(L, 3); arg1 = DelegateFactory.CreateDelegate(typeof(EventSystem.EventDelegate), func) as EventSystem.EventDelegate; } EventSystem.EventDispatcherAddMode arg2 = (EventSystem.EventDispatcherAddMode)ToLua.ToObject(L, 4); bool o = obj.AddEventListener(arg0, arg1, arg2); LuaDLL.lua_pushboolean(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: EventSystem.EventDispatcher.AddEventListener")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int OnApplicationQuit(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.CheckObject(L, 1, typeof(EventSystem.EventDispatcher)); obj.OnApplicationQuit(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveAllEventListeners(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.CheckObject(L, 1, typeof(EventSystem.EventDispatcher)); bool o = obj.RemoveAllEventListeners(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int DispatchEvent(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); EventSystem.EventDispatcher obj = (EventSystem.EventDispatcher)ToLua.CheckObject(L, 1, typeof(EventSystem.EventDispatcher)); EventSystem.IEvent arg0 = (EventSystem.IEvent)ToLua.CheckObject(L, 2, typeof(EventSystem.IEvent)); bool o = obj.DispatchEvent(arg0); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }