Beispiel #1
0
    static int set_OnUpdateData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaTestProxy obj = (LuaTestProxy)o;
            DelegateHelper.VoidDelegate arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (DelegateHelper.VoidDelegate)ToLua.CheckObject(L, 2, typeof(DelegateHelper.VoidDelegate));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(DelegateHelper.VoidDelegate), func) as DelegateHelper.VoidDelegate;
            }

            obj.OnUpdateData = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index OnUpdateData on a nil value" : e.Message));
        }
    }
Beispiel #2
0
 static int OnInit(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaTestProxy obj = (LuaTestProxy)ToLua.CheckObject(L, 1, typeof(LuaTestProxy));
         obj.OnInit();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #3
0
    static int get_OnUpdateData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaTestProxy obj = (LuaTestProxy)o;
            DelegateHelper.VoidDelegate ret = obj.OnUpdateData;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index OnUpdateData on a nil value" : e.Message));
        }
    }
Beispiel #4
0
    static int set_BagItemDataList(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaTestProxy obj = (LuaTestProxy)o;
            System.Collections.Generic.List <int> arg0 = (System.Collections.Generic.List <int>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <int>));
            obj.BagItemDataList = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index BagItemDataList on a nil value" : e.Message));
        }
    }
Beispiel #5
0
    static int get_BagItemDataList(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            LuaTestProxy obj = (LuaTestProxy)o;
            System.Collections.Generic.List <int> ret = obj.BagItemDataList;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index BagItemDataList on a nil value" : e.Message));
        }
    }
Beispiel #6
0
    static int _CreateLuaTestProxy(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                LuaTestProxy obj = new LuaTestProxy();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LuaTestProxy.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }