// TODO 在委托调用中减掉一个LuaFunction, 此lua函数在委托中还会执行一次, 所以必须延迟删除,委托值类型表现之一 internal void DelayDispose(LuaBaseRef br) { if (br != null) { subList.Add(br); } }
static bool Equals(LuaBaseRef a, LuaBaseRef b) { if (System.Object.ReferenceEquals(a, b)) { return(true); } object l = a; object r = b; if (l == null && r != null) { return(b.luaState == null); } if (l != null && r == null) { return(a.luaState == null); } if (a.reference != b.reference || a.luaState != b.luaState) { return(false); } return(true); }
static bool CompareRef(LuaBaseRef a, LuaBaseRef b) { if (System.Object.ReferenceEquals(a, b)) { return(true); } object l = a; object r = b; if (l == null && r != null) { return(b.reference <= 0); } if (l != null && r == null) { return(a.reference <= 0); } if (a.reference != b.reference) { return(false); } return(a.reference > 0); }
public override bool Equals(object o) { if (o == null) { return(this.reference <= 0); } LuaBaseRef luaBaseRef = o as LuaBaseRef; return(!(luaBaseRef == null) && luaBaseRef.reference == this.reference && this.reference > 0); }
public override bool Equals(object o) { if (o == null) { return(false); } LuaBaseRef luaBaseRef = o as LuaBaseRef; return(luaBaseRef != null && luaBaseRef.reference == this.reference); }
public void Push(LuaBaseRef lbr) { if (lbr == null) { LuaPushNil(); } else { LuaGetRef(lbr.GetReference()); } }
public static void Push(IntPtr L, LuaBaseRef lbr) { if (lbr == null) { LuaDLL.lua_pushnil(L); } else { LuaDLL.lua_getref(L, lbr.GetReference()); } }
public override bool Equals(object o) { if (o == null) { return(reference <= 0); } LuaBaseRef lr = o as LuaBaseRef; if (lr == null || lr.reference != reference) { return(false); } return(reference > 0); }
private static bool CompareRef(LuaBaseRef a, LuaBaseRef b) { if (object.ReferenceEquals(a, b)) { return(true); } if (a == null && b != null) { return(b == null || b.reference <= 0); } if (a != null && b == null) { return(a.reference <= 0); } return(a.reference == b.reference && a.reference > 0); }
public override bool Equals(object o) { if (o == null) { return(luaState == null); } if (System.Object.ReferenceEquals(this, o)) { return(true); } LuaBaseRef r = o as LuaBaseRef; if (r == null || r.reference != reference || r.luaState != luaState) { return(false); } return(true); }
public LuaBaseRef TryGetLuaRef(int reference) { WeakReference weak = null; if (funcRefMap.TryGetValue(reference, out weak)) { if (weak.IsAlive) { LuaBaseRef luaRef = (LuaBaseRef)weak.Target; if (luaRef.IsAlive) { luaRef.AddRef(); return(luaRef); } } funcRefMap.Remove(reference); } return(null); }
public void Push(LuaBaseRef lbr) { luaState.Push(lbr); ++argCount; }
static bool CompareRef(LuaBaseRef a, LuaBaseRef b) { if (System.Object.ReferenceEquals(a, b)) { return true; } object l = a; object r = b; if (l == null && r != null) { return r == null || b.reference <= 0; } if (l != null && r == null) { return a.reference <= 0; } if (a.reference != b.reference) { return false; } return a.reference > 0; }
public void Push(LuaBaseRef lbr) { luaState.Push(lbr); }
public static bool operator !=(LuaBaseRef a, LuaBaseRef b) { return(!LuaBaseRef.CompareRef(a, b)); }
public void Push(LuaBaseRef lbr) { this.luaState.Push(lbr); this.argCount++; }