public EntityManager(EntityWorld entityWorld) { Debug.Assert(entityWorld != null, "EntityWorld must not be null."); _uniqueIdToEntities = new Dictionary <long, Entity>(); _removedAndAvailable = new Bag <Entity>(); _componentsByType = new Bag <Bag <IComponent> >(); ActiveEntities = new Bag <Entity>(); _identifierPool = new Bag <int>(4); RemovedEntitiesRetention = 100; this._entityWorld = entityWorld; RemovedComponentEvent += this.EntityManagerRemovedComponentEvent; }