Aspect class
An Aspect is used by systems as a matcher against entities, to check if a system is interested in an entity. Aspects define what sort of component types an entity must possess, or not possess.
This creates an aspect where an entity must possess A and B and C:
Aspect.forAllOf(A, B, C
)
This creates an aspect where an entity must possess A and B and C, but must
not possess U or V.
Aspect.forAllOf(A, B, C
)..exclude(U, V
)
This creates an aspect where an entity must possess A and B and C, but must
not possess U or V, but must possess one of X or Y or Z.
Aspect.forAllOf(A, B, C
)..exclude(U, V
)..oneOf(X, Y, Z
)
You can create and compose aspects in many ways:
Aspect.empty()..oneOf(X, Y, Z
)..allOf(A, B, C
)..exclude(U, V
)
is the same as:
Aspect.forAllOf(A, B, C
)..exclude(U, V
)..oneOf(X, Y, Z
)
Constructors
- Aspect.empty()
- Creates and returns an empty aspect. This can be used if you want a system that processes no entities, but still gets invoked. Typical usages is when you need to create special purpose systems for debug rendering, like rendering FPS, how many entities are active in the world, etc.
-
Aspect.forAllOf(List<
Type> componentTypes) - Creates an aspect where an entity must possess all of the specified components.
-
Aspect.forOneOf(List<
Type> componentTypes) - Creates an aspect where an entity must possess one of the specified componens.
Properties
- all → BitSet
-
The bitmask of all aspects combined via allOf.
no setter
- excluded → BitSet
-
The bitmask of all aspects combined via exclude.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- one → BitSet
-
The bitmask of all aspects combined via oneOf.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
allOf(
List< Type> componentTypes) → void - Modifies the aspect in a way that an entity must possess all of the specified components.
-
exclude(
List< Type> componentTypes) → void - Excludes all of the specified components from the aspect. A system will not be interested in an entity that possesses one of the specified excluded components.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
oneOf(
List< Type> componentTypes) → void - Modifies the aspect in a way that an entity must possess one of the specified components.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited