World class

Manages entities and their associated components, facilitating the creation, addition, querying, updating, and removal of components within an Entity-Component-System (ECS) framework.

Constructors

World()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAllComponents(Entity<Object> entity, Set<Component> components) → void
Adds all components to the entity.
addComponent(Entity<Object> entity, Component component) → void
Adds the component to the entity
createUniqueEntity() WorldEntity<Object>
Creates a new WorldEntity with a unique ID.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(List<Iterable<WorldEntity<Object>> Function()> queries) Set<WorldEntity<Object>>
Queries entities that satisfy all the provided conditions.
query1<T1 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified component T1.
query2<T1 extends Component, T2 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have both the specified components T1 and T2.
query3<T1 extends Component, T2 extends Component, T3 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, and T3.
query4<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, and T4.
query5<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component, T5 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, T4, and T5.
query6<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component, T5 extends Component, T6 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, T4, T5, and T6.
query7<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component, T5 extends Component, T6 extends Component, T7 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, T4, T5, T6, and T7.
query8<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component, T5 extends Component, T6 extends Component, T7 extends Component, T8 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, T4, T5, T6, T7, and T8.
query9<T1 extends Component, T2 extends Component, T3 extends Component, T4 extends Component, T5 extends Component, T6 extends Component, T7 extends Component, T8 extends Component, T9 extends Component>() Iterable<WorldEntity<Object>>
Queries entities that have the specified components T1, T2, T3, T4, T5, T6, T7, T8, and T9.
removeEntity(Entity<Object> entity) → void
Removes the given entity and its associated components from the registry.
toString() String
A string representation of this object.
inherited
updateComponent<T extends Component>(Entity<Object> entity, T newComponent) Result<Component, String>
Updates the component of type T for the given entity. Returns an Ok with the updated component or an Err if the component does not exist.
withComponent<T extends Component>() Iterable<WorldEntity<Object>>
Returns the entities that have the specified component.

Operators

operator ==(Object other) bool
The equality operator.
inherited