public void BirthSimEnt(SimEntity simEntity) { // make the sets by getting them HashSet <ISimEventHandle> fromHandles = Instance().GetEventsFrom(simEntity); HashSet <ISimEventHandle> toHandles = Instance().GetEventsTo(simEntity); if (fromHandles.Count == toHandles.Count) { //dummy if warning removal } }
private void KillAll() { while (_from2set.Keys.Count > 0) { SimEntity se = null; IEnumerator enumerator = _from2set.Keys.GetEnumerator(); enumerator.MoveNext(); se = (SimEntity)enumerator.Current; se.Kill(); } }
public void KillSimEnt(SimEntity simEntity) { // clone to avoid concurrent modifications from deregister HashSet <ISimEventHandle> fromHandles = new HashSet <ISimEventHandle>(); fromHandles.AddAll <ISimEventHandle>(GetEventsFrom(simEntity)); foreach (ISimEventHandle eventHandle in fromHandles) { Deregister(eventHandle); } _from2set.Remove(simEntity); // clone to avoid concurrent modifications from deregister HashSet <ISimEventHandle> toHandles = new HashSet <ISimEventHandle>(); toHandles.AddAll <ISimEventHandle>(GetEventsTo(simEntity)); foreach (ISimEventHandle eventHandle in toHandles) { Deregister(eventHandle); } _to2set.Remove(simEntity); }