EntityMatcher class

A class that describe a way to filter entities.

There are 3 properties, each with it's own functionality. all: The entity MUST contain all of these components. any: The entity MUST contain at least one of these components. inverse: Flips the logic, so MUST becomes MUST NOT.

var matcher = EntityMatcher(all: CountComponent, PriceComponent) This matcher would match any entity that has both the CountComponent AND the Price Component.

var matcher = EntityMatcher(all: CartComponent, any: PriceComponent, CouponComponent) This matcher would match any entity that has the CartComponent, and has at least one between the PriceComponent and CouponComponent.

var matcher = EntityMatcher(all: DiscontinuedComponent, PriceComponent, reverse: true) This matcher would match any entity that DOES NOT have the DiscontinuedComponent and PriceComponent.

var matcher = EntityMatcher(any: DiscontinuedComponent, OutOfStockComponent, DisabledComponent, reverse: true) This matcher would match any entity that DOES NOT have any one of these components.

Constructors

EntityMatcher({Set<Type> all = const {}, Set<Type> any = const {}, bool reverse = false})
const

Properties

all Set<Type>
final
any Set<Type>
final
hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
reverse bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

contains(Type type) bool
match(EntitySystem system) List<Entity>
matches(Entity entity) bool
matchesAll(Entity entity) bool
matchesAny(Entity entity) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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