public static void Sub(Order ordername, DeusEvent ge) { if (_eventBag.TryGetValue(ordername, out DeusEvent existing)) { existing += ge; } else { existing = ge; } _eventBag[ordername] = existing; }
public static void UnSub(Order ordername, DeusEvent ge) { if (_eventBag.TryGetValue(ordername, out DeusEvent existing)) { existing -= ge; } if (existing == null) { _eventBag.Remove(ordername); } else { _eventBag[ordername] = existing; } }