FlowControllerSystem
The FlowControllerSystem provides FlowController, an abstract base class that connects one Domain on the command bus to the code that handles that domain's commands. It is part of the SaffronLibrary Prime systems, under _Core/Execution.
Key responsibilities
- Domain registration: During
Init, each controller registers itsHandleCommandmethod on theCommandBusfor itsDomain, so commands addressed to that domain are routed to it. - Command handling entry point: Subclasses implement
HandleCommandto hold the domain's command processing logic. Each domain should have exactly one flow controller. - Initialization integration:
FlowControllerimplementsIInitializable, so theInitializationManagerpipeline callsInitat boot. Subclasses that overrideInitmust callbase.Init()to keep registration working.
Who should use it
Gameplay and engineering developers who add a new domain or own the command logic for an existing one. Subclass FlowController, return the matching Domain value, and implement HandleCommand. Developers who only send commands should use the command bus and command types, not this class.
Connections
The controller depends on the bootstrap and messaging layers. InitializationManager constructs and initializes it, ServiceLocator supplies the bus registry, and CommandBus performs the routing. The Domain enum and ICommand define the routing key and the payload type.