Example #1
0
        /// <summary>Full Lua equality which can be controlled with metatables.</summary>
        public bool LuaEquals(LuaBase o)
        {
            if (o == null || o.Owner != Owner)
            {
                return(false);
            }
            var L = Owner._L;

            luanet.checkstack(L, 2, "LuaBase.LuaEquals");
            rawpush(L);
            o.rawpush(L);
            try { return(lua.equal(L, -1, -2)); }
            finally { lua.pop(L, 2); }
        }
Example #2
0
        /// <summary>Raw equality. (For table field lookups, Lua uses raw comparisons internally.)</summary>
        public bool Equals(LuaBase o)
        {
            if (o == null || o.Owner != Owner)
            {
                return(false);
            }
            var L = Owner._L;

            luanet.checkstack(L, 2, "LuaBase.Equals");
            rawpush(L);
            o.rawpush(L);
            bool ret = lua.rawequal(L, -1, -2);

            lua.pop(L, 2);
            return(ret);
        }
Example #3
0
        /// <summary>Full Lua equality which can be controlled with metatables.</summary>
        public bool LuaEquals(LuaBase o)
        {
            if (o == null || o.Owner != Owner)
            {
                return(false);
            }
            var L = Owner._L;

            luaclr.checkstack(L, 2, "LuaBase.LuaEquals");
            rawpush(L);
            o.rawpush(L);
            int oldTop = -3;

            try { return(lua.equal(L, -1, -2)); }
            catch (LuaInternalException) { oldTop = -1; throw; }
            finally { lua.settop(L, oldTop); }
        }