abstract class Entitas::ReactiveSystem
- Entitas::ReactiveSystem
 - Reference
 - Object
 
Overview
A Entitas::ReactiveSystem calls Execute(entities) if there were changes based on
the specified Entitas::Collector and will only pass in changed entities.
A common use-case is to react to changes, e.g. a change of the position
of an entity to update the gameObject.transform.position
of the related gameObject.
Included Modules
Defined in:
entitas/reactive_system.crConstant Summary
- 
        Log = 
::Log.for(self) 
Constructors
Instance Method Summary
- 
        #activate
        
          
Activates the
ReactiveSystemand starts observing changes based on the specifiedCollector. - 
        #clear
        
          
Clears all accumulated changes.
 - 
        #deactivate
        
          
Deactivates the
ReactiveSystem. - #execute(entities : Array(Entitas::IEntity))
 - #execute : Nil
 - 
        #filter(entity)
        
          
This will exclude all entities which don't pass the filter.
 - 
        #get_trigger(context : Entitas::Context) : ICollector
        
          
Specify the collector that will trigger the ReactiveSystem.
 - #to_s(io)
 
Instance methods inherited from module Entitas::Systems::ReactiveSystem
  
  
    
      activate
    activate, 
    
  
    
      clear
    clear, 
    
  
    
      deactivate
    deactivate
    
  
    
    
  
    
  Instance methods inherited from module Entitas::Systems::ExecuteSystem
  
  
    
      execute
    execute
    
  
    
    
  
    
  Instance methods inherited from module Entitas::System
  
  
    
      to_json(json : JSON::Builder)
    to_json
    
  
    
    
  
    
  Instance methods inherited from module Entitas::System
  
  
    
      to_json(json : JSON::Builder)
    to_json
    
  
    
    
  
    
    
    
  
    
    
    
  
Constructor Detail
Instance Method Detail
Activates the ReactiveSystem and starts observing changes
based on the specified Collector.
ReactiveSystem are activated by default.
Deactivates the ReactiveSystem.
No changes will be tracked while deactivated.
This will also clear the ReactiveSystem.
ReactiveSystem are activated by default.
Specify the collector that will trigger the ReactiveSystem.