public void Clear() { if (MobRemoved != null) { MobRemoveEventArgs m = new MobRemoveEventArgs(-1); foreach (System.EventHandler <MobRemoveEventArgs> e in MobRemoved?.GetInvocationList()) { e.BeginInvoke(this, m, e.EndInvoke, null); } } objectToMobMap.Clear(); }
public void Clear() { if (MobRemoved != null) { MobRemoveEventArgs m = new MobRemoveEventArgs(-1); foreach (System.EventHandler <MobRemoveEventArgs> e in MobRemoved?.GetInvocationList()) { Task.Run(() => e.Invoke(this, m)); } } objectToMobMap.Clear(); }
public void RemoveMob(int objectId) { if (objectToMobMap.ContainsKey(objectId)) { objectToMobMap.Remove(objectId); if (MobRemoved != null) { MobRemoveEventArgs m = new MobRemoveEventArgs(objectId); foreach (System.EventHandler <MobRemoveEventArgs> e in MobRemoved?.GetInvocationList()) { e.BeginInvoke(this, m, e.EndInvoke, null); } } } }