An aspect for matching entities' components against. This is used to check if a system is interested in processing an entity.

This can be constructed by using the Aspect.build(_) macro. Using this, you can build a aspect from a binary operation representing the combination of types this will expect.

Binary Syntax

All of...

Aspect.build(Position & Velocity);

One of...

Aspect.build(Position | Velocity);

None of...

Aspect.build(!Position);

Alternate syntax

Aspect.build({
	all: [Position, Velocity, Gravity, Physical],
	none: Frozen
})

Constructor

new (allSet:BitVector, oneSet:BitVector, noneSet:BitVector)

Create a new aspect from bit vectors.

Parameters:

allSet

The components to require all of.

oneSet

The components to require at least one of.

noneSet

The components to require none of.

Methods

matches (componentBits:BitVector):Bool

Returns true if the components set fulfills this aspect.

Parameters:

components

The BitVector of components to check against.

Returns:

If the components set fulfills this aspect.

toString ():String

Make a string representation of this aspect.

Returns:

The string representation.

Static methods

staticinline any ():AnyAspect

Matches any combo of components.

Returns:

The aspect.

staticbuild (expr:Dynamic):Aspect