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 theentity
. -
addComponent(
Entity< Object> entity, Component component) → void -
Adds the
component
to theentity
.å -
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< queries) → Set<WorldEntity< Function()>Object> >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
andT2
. -
query3<
T1 extends Component, T2 extends Component, T3 extends Component> () → Iterable< WorldEntity< Object> > -
Queries entities that have the specified components
T1
,T2
, andT3
. -
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
, andT4
. -
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
, andT5
. -
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
, andT6
. -
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
, andT7
. -
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
, andT8
. -
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
, andT9
. -
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