コード例 #1
0
        static int _m_Check(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    int _check_pos = LuaAPI.xlua_tointeger(L, 2);
                    int _max_check = LuaAPI.xlua_tointeger(L, 3);
                    System.Func <object, bool> _checker = translator.GetDelegate <System.Func <object, bool> >(L, 4);
                    System.Collections.Generic.Dictionary <object, int> _reverse_map = (System.Collections.Generic.Dictionary <object, int>)translator.GetObject(L, 5, typeof(System.Collections.Generic.Dictionary <object, int>));

                    int gen_ret = gen_to_be_invoked.Check(_check_pos, _max_check, _checker, _reverse_map);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



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


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



                {
                    int    _index = LuaAPI.xlua_tointeger(L, 2);
                    object _o     = translator.GetObject(L, 3, typeof(object));

                    object gen_ret = gen_to_be_invoked.Replace(_index, _o);
                    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_TryGetValue(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    int    _index = LuaAPI.xlua_tointeger(L, 2);
                    object _obj;

                    bool gen_ret = gen_to_be_invoked.TryGetValue(_index, out _obj);
                    LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.PushAny(L, _obj);



                    return(2);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #4
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    XLua.ObjectPool gen_ret = new XLua.ObjectPool();
                    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.ObjectPool constructor!"));
        }
コード例 #5
0
        static int _m_Clear(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLua.ObjectPool gen_to_be_invoked = (XLua.ObjectPool)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));
            }
        }
コード例 #6
0
        public static int __CSIndexer(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                if (translator.Assignable <XLua.ObjectPool>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    XLua.ObjectPool gen_to_be_invoked = (XLua.ObjectPool)translator.FastGetCSObj(L, 1);
                    int             index             = LuaAPI.xlua_tointeger(L, 2);
                    LuaAPI.lua_pushboolean(L, true);
                    translator.PushAny(L, gen_to_be_invoked[index]);
                    return(2);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            LuaAPI.lua_pushboolean(L, false);
            return(1);
        }
コード例 #7
0
        static int _m_Add(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    object _obj = translator.GetObject(L, 2, typeof(object));

                    int gen_ret = gen_to_be_invoked.Add(_obj);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



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