EntityList.md
July 25, 2024 · View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS
EntityList Class
A list of entities of a specific EntityStore used to apply changes to all entities in the container.
It's recommended to reuse instances of this class to avoid unnecessary allocations.
See Example.
public sealed class EntityList :
System.Collections.Generic.IList<Friflo.Engine.ECS.Entity>,
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Entity>,
System.Collections.Generic.IEnumerable<Friflo.Engine.ECS.Entity>,
System.Collections.IEnumerable
Inheritance System.Object 🡒 EntityList
Implements System.Collections.Generic.IList<Entity>, System.Collections.Generic.ICollection<Entity>, System.Collections.Generic.IEnumerable<Entity>, System.Collections.IEnumerable
| Constructors | |
|---|---|
| EntityList() | Creates a container for entities returned by a query to perform structural changes. This constructor is intended for use in ToEntityList(). |
| EntityList(EntityStore) | Creates a container to store entities of the given store. |
| Properties | |
|---|---|
| Capacity | |
| Count | Returns the number of entities stored in the container. |
| EntityStore | Returns the store to which the list entities belong to. |
| Ids | Return the ids of entities stored in the container. |
| IsReadOnly | Gets a value indicating whether the System.Collections.ICollection is read-only. |
| this[int] | Return the entity at the given index. |
| Methods | |
|---|---|
| Add(Entity) | Adds the given entity to the end of the EntityList. |
| Add(int) | Adds the entity with the given id to the end of the EntityList. |
| AddTree(Entity) | Adds the entity and recursively all child entities of the given entity to the end of the EntityList. |
| ApplyAddTags(Tags) | Adds the given tags to all entities in the EntityList. |
| ApplyBatch(EntityBatch) | Apply the given batch to all entities in the EntityList. |
| ApplyRemoveTags(Tags) | Removes the given tags from all entities in the EntityList. |
| Clear() | Removes all entities from the EntityList. |
| Contains(Entity) | not implemented |
| CopyTo(Entity[], int) | Copies the entities of the EntityList to an Entity[], starting at the given index |
| GetEnumerator() | Returns an enumerator that iterates through the EntityList. |
| IndexOf(Entity) | not implemented |
| Insert(int, Entity) | not implemented |
| Remove(Entity) | not implemented |
| RemoveAt(int) | not implemented |
| SetStore(EntityStore) | Set the store to which the list entities belong to. EntityList must be empty when setting EntityStore. |
| ToString() |
| Explicit Interface Implementations | |
|---|---|
| System.Collections.Generic.IEnumerable<Friflo.Engine.ECS.Entity>.GetEnumerator() | |
| System.Collections.IEnumerable.GetEnumerator() |