Function System.from

Dynamically generate a new System instance given a function.

SystemGenerator from(alias Func)()
if (isCallableAsSystem!Func);

When a generated System is run it will try to apply the World's Entities, Components, and Resources to the function's parameters.

See isCallableAsSystem § Satisfaction Requirements to understand the requirements of isCallableAsSystem.

See Parameter Application to understand how parameters are applied at runtime.

See Also: isCallableAsSystem

Parameter Application

When ran, a generated System will:
  1. For each of the World's Entities, either:
    1. Apply a constant reference to the World for World parameters
    2. Apply a constant reference to the current Entity for Entity parameters
    3. Apply a constant reference to the World's Resources for Resources parameters
    4. Apply a constant reference to the generated System for System parameters
    5. Try to find a matching Entity Component to apply given a parameter's type and name:
      • struct and Component parameter names must match an Entity's Component name
    6. Try to find a matching World Resource to apply given the parameter's type is one of:
    7. Or, if a parameter could not be applied, continue to the next Entity
  2. Call the user-provided function for Entities if and only if all parameters were be applied
  3. For all struct and Component parameters with the ref storage class, update the Component


A newly instantiated SystemGenerator, a function that initializes a new generated System given a World reference.

See Also