c1_unity/Assets/XLua/Gen/BF_BFEventBaseWrap.cs
2023-04-03 11:04:31 +08:00

201 lines
5.4 KiB
C#

#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif
using XLua;
using System.Collections.Generic;
namespace XLua.CSObjectWrap
{
using Utils = XLua.Utils;
public class BFBFEventBaseWrap
{
public static void __Register(RealStatePtr L)
{
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(BF.BFEventBase);
Utils.BeginObjectRegister(type, L, translator, 0, 4, 0, 0);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CallbackCount", _m_CallbackCount);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddListener", _m_AddListener);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RemoveListener", _m_RemoveListener);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Clear", _m_Clear);
Utils.EndObjectRegister(type, L, translator, null, null,
null, null, null);
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
Utils.EndClassRegister(type, L, translator);
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int __CreateInstance(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
if(LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
{
int _length = LuaAPI.xlua_tointeger(L, 2);
var gen_ret = new BF.BFEventBase(_length);
translator.Push(L, gen_ret);
return 1;
}
}
catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return LuaAPI.luaL_error(L, "invalid arguments to BF.BFEventBase constructor!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_CallbackCount(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
BF.BFEventBase gen_to_be_invoked = (BF.BFEventBase)translator.FastGetCSObj(L, 1);
{
var gen_ret = gen_to_be_invoked.CallbackCount( );
LuaAPI.xlua_pushinteger(L, gen_ret);
return 1;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_AddListener(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
BF.BFEventBase gen_to_be_invoked = (BF.BFEventBase)translator.FastGetCSObj(L, 1);
{
System.Delegate _del = translator.GetDelegate<System.Delegate>(L, 2);
gen_to_be_invoked.AddListener( _del );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_RemoveListener(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
BF.BFEventBase gen_to_be_invoked = (BF.BFEventBase)translator.FastGetCSObj(L, 1);
{
System.Delegate _del = translator.GetDelegate<System.Delegate>(L, 2);
gen_to_be_invoked.RemoveListener( _del );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_Clear(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
BF.BFEventBase gen_to_be_invoked = (BF.BFEventBase)translator.FastGetCSObj(L, 1);
{
gen_to_be_invoked.Clear( );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
}
}