Beispiel #1
0
 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();
 }
Beispiel #3
0
 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);
             }
         }
     }
 }