World class
ECS World - Manages all entities and systems
The central manager for the Entity-Component System. Creates entities, manages systems, and coordinates updates.
Constructors
- World()
Properties
-
activeEntities
→ Iterable<
Entity> -
Get active entities
no setter
-
entities
→ UnmodifiableListView<
Entity> -
Get all entities
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stats
→ Map<
String, dynamic> -
Get statistics
no setter
-
systems
→ UnmodifiableListView<
System> -
Get all systems
no setter
Methods
-
addSystem(
System system) → void - Add a system to the world
-
createEntity(
{String? name}) → Entity - Create a new entity
-
createEntityWithComponents(
List< Component> components, {String? name}) → Entity - Create an entity with components
-
destroyAllEntities(
) → void - Destroy all entities
-
destroyEntity(
Entity entity) → void - Destroy an entity
-
dispose(
) → void - Dispose the world and all systems
-
findEntityByName(
String name) → Entity? - Find entity by name
-
getEntity(
EntityId id) → Entity? - Get entity by ID
-
getSystem<
T extends System> () → T? - Get a system by type
-
initialize(
) → void - Initialize the world
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
List< Type> componentTypes) → Iterable<Entity> - Find entities with specific components
-
removeSystem(
System system) → void - Remove a system from the world
-
render(
Canvas canvas, Size size) → void - Render all active systems
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double deltaTime) → void - Update all active systems
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited