Beispiel #1
0
        public override bool Equals(object o)
        {
            if (o != null && this.GetType() == o.GetType())
            {
#if THREAD_SAFE || HOTFIX_ENABLE
                lock (luaEnv.luaEnvLock)
                {
#endif
                LuaBase rhs = ( LuaBase )o;
                var L       = luaEnv.L;
                if (L != rhs.luaEnv.L)
                {
                    return(false);
                }
                int top = LuaAPI.lua_gettop(L);
                LuaAPI.lua_getref(L, rhs.luaReference);
                LuaAPI.lua_getref(L, luaReference);
                int equal = LuaAPI.lua_rawequal(L, -1, -2);
                LuaAPI.lua_settop(L, top);
                return(equal != 0);

#if THREAD_SAFE || HOTFIX_ENABLE
            }
#endif
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        static int _m_Dispose(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    gen_to_be_invoked.Dispose(  );



                    return(0);
                }
                if (gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
                {
                    bool _disposeManagedResources = LuaAPI.lua_toboolean(L, 2);

                    gen_to_be_invoked.Dispose(_disposeManagedResources);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to XLua.LuaBase.Dispose!"));
        }
Beispiel #3
0
 public void Push(RealStatePtr L, LuaBase o)
 {
     if (o == null)
     {
         LuaAPI.lua_pushnil(L);
     }
     else
     {
         o.push(L);
     }
 }
Beispiel #4
0
        static int _m_GetHashCode(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    int gen_ret = gen_to_be_invoked.GetHashCode(  );
                    LuaAPI.xlua_pushinteger(L, gen_ret);



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



                {
                    int         _reference = LuaAPI.xlua_tointeger(L, 1);
                    XLua.LuaEnv _luaenv    = (XLua.LuaEnv)translator.GetObject(L, 2, typeof(XLua.LuaEnv));

                    XLua.LuaBase gen_ret = XLua.CSObjectWrap.SystemCollectionsIEnumeratorBridge.__Create(_reference, _luaenv);
                    translator.Push(L, gen_ret);



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


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



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

                    bool gen_ret = gen_to_be_invoked.Equals(_o);
                    LuaAPI.lua_pushboolean(L, gen_ret);



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