ECS::System
Inherits Reference / Object
Сontainer for logic for processing filtered entities.
User systems should inherit from ECS::System
and implement init, execute, teardown, filter, preprocess and process (in any combination. Just skip methods you don't need).
Constructors
Instance methods
filter(world : World) : Filter | Nil
Called once during ECS::Systems.init, after #init call.
If this method is present, it should return a filter that will be applied to a world
It can also return nil that means that no filter is present and #process won't be called
Example:
def filter(world : World)
world.of(Component1)
end
process(entity : Entity)
Called during each ECS::Systems.execute call, before #execute, for each entity that match the #filter