IEntityWorld Interface

Interface for the entity world that manages all entities and systems.

public interface IEntityWorld : System.IDisposable

Derived
EntityWorld

Implements System.IDisposable

Properties
Entities Gets all entities in the world.
FixedUpdateSystems Gets all fixed update systems in this world.
RenderSystems Gets all render systems in this world.
UpdateSystems Gets all update systems in this world.
Methods
AddSystem<T>(Action<T>) Adds a system to this world, automatically creating it with dependency injection. Systems that implement IUpdateSystem are added to the update pipeline. Systems that implement IFixedUpdateSystem are added to the fixed update pipeline. Systems that implement IRenderSystem are added to the render pipeline. Systems can implement multiple interfaces.
Clear() Clears all entities and systems from the world, disposing any systems that implement System.IDisposable. The world remains usable after this call.
ClearEntities() Destroys all entities but keeps systems and their configuration intact. Useful for scene resets without reloading.
CreateCachedQuery<T1>() Creates a cached query builder for better performance when querying repeatedly.
CreateEntity(string) Creates a new entity in the world.
CreateEntity<T>(string) Creates a new entity of a specific type.
DestroyEntity(Entity) Destroys an entity and removes it from the world.
FindEntity(Func<Entity,bool>) Finds the first entity that matches the specified predicate.
FixedUpdate(GameTime) Runs one fixed timestep for all fixed update systems and behaviors. Called by the game loop's accumulator; not intended for direct use.
Flush() Forces immediate processing of all deferred operations.
ForEachWithTag(string, Action<Entity>) Invokes action for every active entity that has the specified tag, using the internal tag index for O(tagged entities) lookup and an System.Buffers.ArrayPool<> snapshot for safe iteration when the action modifies tags.
GetEntitiesByTag(string) Gets all active entities with a specific tag.
GetEntitiesWithComponent<T>() Gets all entities with a specific component type.
GetEntitiesWithComponents<T1,T2>() Gets all entities that have both specified component types. Iterates the smaller pool to minimise cross-resolves.
GetEntityById(long) Gets an entity by its unique ID.
GetEntityByName(string) Gets an entity by name (returns first match).
GetFixedUpdateSystem<T>() Gets a fixed update system of the specified type.
GetRenderSystem<T>() Gets a render system of the specified type.
GetSystem<T>() Gets a system of the specified type (checks all pipelines).
GetUpdateSystem<T>() Gets an update system of the specified type.
HasFixedUpdateSystem<T>() Checks if a fixed update system of the specified type exists in this world.
HasRenderSystem<T>() Checks if a render system of the specified type exists in this world.
HasUpdateSystem<T>() Checks if an update system of the specified type exists in this world.
Query() Creates a fluent query builder for searching entities.
RemoveSystem(ISystem) Removes a system by instance reference. If the system implements multiple pipeline interfaces it will be removed from all.
RemoveSystem<T>() Removes a system of the specified type from this world. If the system implements multiple pipeline interfaces it will be removed from all.
Render(IRenderer) Renders all systems and entities in the world.
Update(GameTime) Updates all systems and entities in the world.