struct ECS::SimpleFilter
- ECS::SimpleFilter
- Struct
- Value
- Object
Overview
Stack allocated filter - can iterate over one component type.
Included Modules
Defined in:
myecs.crConstructors
-
.new(world : ECS::World, typ : ::ECS::Component.class)
Creates SimpleFilter.
Instance Method Summary
- #each(& : Entity -> )
-
#satisfy(entity : Entity) : Bool
returns true if entity satisfy filter (contain a component
#typ
) -
#size
Returns number of entities that match the filter.
-
#typ : ComponentType
type of components that this filter iterate
-
#world : World
world that owns this filtetr
Instance methods inherited from module ECS::AbstractFilter
satisfy(entity : Entity) : Bool
satisfy
Constructor Detail
Creates SimpleFilter. An easier way is to do world.query(typ)
Instance Method Detail
iterates over all entities containing component #typ
Note that for Multiple
same entity can be yielded multiple times, once for each component present on entity
returns true if entity satisfy filter (contain a component #typ
)