public ComponentsPool(ComponentType componentType, ConstructorInfo constructor, int capacity = 32) { _componentType = componentType; _constructor = constructor; _components = new Stack<Component>(capacity); }
internal Component GetComponent(Entity entity, ComponentType type) { Bag<Component> components; if (_globalStorage.TryGetValue(entity.Id, out components)) { Component component; if (components.TryGetValue(type.Id, out component)) return component; } return null; }