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
- 
        #count_entities
        
          Returns number of entities that match the filter. 
- 
        #each_entity(& : Entity -> )
        
          iterates over all entities containing component #typNote that forMultipleComponentssame entity can be yielded multiple times, once for each component present on entity
- 
        #satisfy(entity : Entity) : Bool
        
          returns true if entity satisfy filter (contain a component #typ)
- 
        #typ : ComponentType
        
          type of components that this filter iterate 
- 
        #world : World
        
          world that owns this filtetr 
Instance methods inherited from module ECS::AbstractFilter
  
  
    
      count_entities
    count_entities, 
    
  
    
      each_entity(& : Entity -> )
    each_entity, 
    
  
    
      find_entity?
    find_entity?, 
    
  
    
      satisfy(entity : Entity) : Bool
    satisfy
    
  
    
    
    
  
    
    
    
    
  
    
    
    
    
  
    
    
    
    
  
Constructor Detail
Creates SimpleFilter. An easier way is to do world.query(typ)
Instance Method Detail
Returns number of entities that match the filter. (in fact - number of components #typ in a world)
iterates over all entities containing component #typ
Note that for MultipleComponents same entity can be yielded multiple times, once for each component present on entity
returns true if entity satisfy filter (contain a component #typ)