示例#1
0
        static int _m_CreateCallbackDelegate_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count >= 2 && translator.Assignable <System.Type>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNONE == LuaAPI.lua_type(L, 3) || translator.Assignable <System.Type>(L, 3)))
                {
                    System.Type   _type       = (System.Type)translator.GetObject(L, 1, typeof(System.Type));
                    string        _methodName = LuaAPI.lua_tostring(L, 2);
                    System.Type[] _paramTypes = translator.GetParams <System.Type>(L, 3);

                    var gen_ret = XLuaHelper.CreateCallbackDelegate(_type, _methodName, _paramTypes);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count >= 2 && translator.Assignable <object>(L, 1) && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNONE == LuaAPI.lua_type(L, 3) || translator.Assignable <System.Type>(L, 3)))
                {
                    object        _target     = translator.GetObject(L, 1, typeof(object));
                    string        _methodName = LuaAPI.lua_tostring(L, 2);
                    System.Type[] _paramTypes = translator.GetParams <System.Type>(L, 3);

                    var gen_ret = XLuaHelper.CreateCallbackDelegate(_target, _methodName, _paramTypes);
                    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 XLuaHelper.CreateCallbackDelegate!"));
        }
示例#2
0
        static int _m_CreateListInstance_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type _itemType = (System.Type)translator.GetObject(L, 1, typeof(System.Type));

                    var gen_ret = XLuaHelper.CreateListInstance(_itemType);
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#3
0
        static int _m_MakeGenericCallbackType_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type[] _paramTypes = translator.GetParams <System.Type>(L, 1);

                    var gen_ret = XLuaHelper.MakeGenericCallbackType(_paramTypes);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#4
0
        static int _m_MakeGenericListType_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type itemType = (System.Type)translator.GetObject(L, 1, typeof(System.Type));

                    System.Type __cl_gen_ret = XLuaHelper.MakeGenericListType(itemType);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
示例#5
0
        static int _m_MakeGenericDictionaryType_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type _keyType   = (System.Type)translator.GetObject(L, 1, typeof(System.Type));
                    System.Type _valueType = (System.Type)translator.GetObject(L, 2, typeof(System.Type));

                    var gen_ret = XLuaHelper.MakeGenericDictionaryType(_keyType, _valueType);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#6
0
        static int _m_CreateArrayInstance_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type itemType  = (System.Type)translator.GetObject(L, 1, typeof(System.Type));
                    int         itemCount = LuaAPI.xlua_tointeger(L, 2);

                    System.Array __cl_gen_ret = XLuaHelper.CreateArrayInstance(itemType, itemCount);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
示例#7
0
        static int _m_CreateDictionaryInstance_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    System.Type keyType   = (System.Type)translator.GetObject(L, 1, typeof(System.Type));
                    System.Type valueType = (System.Type)translator.GetObject(L, 2, typeof(System.Type));

                    System.Collections.IDictionary __cl_gen_ret = XLuaHelper.CreateDictionaryInstance(keyType, valueType);
                    translator.PushAny(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }