private void CleanupDeleted(object sender, EventArgs eargs) { var entity = sender as IEntity; if (entity == null) { return; } entity.Deleted -= CleanupDeleted; _entityPool.Put(entity); Entities.Remove(entity.ID); _gameManager.RemoveEntity(entity); }
protected virtual void AspectDeleted(object sender, EventArgs e) { var aspect = sender as IAspect; if (aspect == null) { return; } aspect.Deleted -= AspectDeleted; if (aspect.IsInChannel(_channelManager.Channel, "all")) { _channelAspects.Remove(aspect); } _aspects.Remove(aspect); _aspectPool.Put(aspect); }
/// <summary> /// Resets and returns the <typeparamref name="{T}"/> back to the <see cref="Pool"/>. /// </summary> public virtual void Dispose() { BackingText = "Default"; BackingNumber = 666; Pool.Put(this); }