using System; using System.Collections; namespace EcsRx.Components { /// /// Acts as a basic memory block for components of a specific type /// /// This helps speed up access when you want components of the same type /// Type of component public interface IComponentPool : IComponentPool, IDisposable where T : IComponent { /// /// Contiguous block of memory for components /// T[] Components { get; } } /// /// Acts as a basic memory block for components of a specific type /// /// This helps speed up access for components of the same type public interface IComponentPool : IEnumerable { /// /// Amount of components within the pool /// int Count { get; } /// /// The amount of indexes remaining in this pool before a resize is needed /// int IndexesRemaining { get; } /// /// To notify when a pool has extended /// IObservable OnPoolExtending { get; } /// /// Automatically expand the pool /// void Expand(); /// /// Manually expand the pool /// /// void Expand(int amountToAdd); /// /// Set a component to a specific index /// /// the index to set /// the component to use void Set(int index, object value); /// /// Allocates space for the pools and indexes /// /// The id of the allocation int Allocate(); /// /// Releases the component at the given index /// /// void Release(int index); } }