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


                XLua.MethodWrapsCache gen_to_be_invoked = (XLua.MethodWrapsCache)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 5 && translator.Assignable <System.Type>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo> >(L, 4) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 5))
                {
                    System.Type _type       = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
                    string      _methodName = LuaAPI.lua_tostring(L, 3);
                    System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo> _methodBases = (System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo>)translator.GetObject(L, 4, typeof(System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo>));
                    bool _forceCheck = LuaAPI.lua_toboolean(L, 5);

                    XLua.MethodWrap gen_ret = gen_to_be_invoked._GenMethodWrap(_type, _methodName, _methodBases, _forceCheck);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && translator.Assignable <System.Type>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo> >(L, 4))
                {
                    System.Type _type       = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
                    string      _methodName = LuaAPI.lua_tostring(L, 3);
                    System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo> _methodBases = (System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo>)translator.GetObject(L, 4, typeof(System.Collections.Generic.IEnumerable <System.Reflection.MemberInfo>));

                    XLua.MethodWrap gen_ret = gen_to_be_invoked._GenMethodWrap(_type, _methodName, _methodBases);
                    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 XLua.MethodWrapsCache._GenMethodWrap!"));
        }
示例#2
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Collections.Generic.List <XLua.OverloadMethodWrap> >(L, 3) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    string _methodName = LuaAPI.lua_tostring(L, 2);
                    System.Collections.Generic.List <XLua.OverloadMethodWrap> _overloads = (System.Collections.Generic.List <XLua.OverloadMethodWrap>)translator.GetObject(L, 3, typeof(System.Collections.Generic.List <XLua.OverloadMethodWrap>));
                    bool _forceCheck = LuaAPI.lua_toboolean(L, 4);

                    XLua.MethodWrap gen_ret = new XLua.MethodWrap(_methodName, _overloads, _forceCheck);
                    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 XLua.MethodWrap constructor!"));
        }
示例#3
0
        static int _m_Call(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLua.MethodWrap gen_to_be_invoked = (XLua.MethodWrap)translator.FastGetCSObj(L, 1);



                {
                    System.IntPtr _L = LuaAPI.lua_touserdata(L, 2);

                    int gen_ret = gen_to_be_invoked.Call(_L);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



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