/// Returns all collected entities and casts them. /// Call collector.ClearCollectedEntities() /// once you processed all entities. public IEnumerable <TCast> GetCollectedEntities <TCast>() where TCast : class, IEntity { return(_collectedEntities.Cast <TCast>()); }