FlowControllerSystem API Reference
Namespace
SaffronLibrary.Prime.Systems.Flow
FlowController
Base class for all flow controllers. Each subclass owns one Domain and handles that domain's commands. Implements IInitializable.
public abstract class FlowController : IInitializableMembers
Domain
The domain this controller owns. Commands whose TargetDomain matches this value are routed to this controller. Each domain should have exactly one flow controller.
protected abstract Domain Domain { get; }Init
Registers this controller's HandleCommand method on the command bus for its Domain. Called during system initialization, before the controller can receive commands. Overrides must call base.Init() so registration still occurs.
public virtual void Init()HandleCommand
The main decision point for handling commands. Concrete subclasses implement the logic for commands addressed to their Domain.
protected abstract void HandleCommand(ICommand cmd)Parameters
cmd(ICommand): The command to process.
Private members (not part of the public surface)
commandBus(CommandBus): Resolved fromServiceLocator.GetBusRegistry().CommandBuson each access. Used byInitto register the handler.
Interfaces implemented
IInitializable(defined in the Initialization interfaces; see the Initialization system documentation). ProvidesInit.
Related types (defined outside this system)
These types are used in the signatures above but are not documented here:
Domain(enum, Contracts system)ICommand(Commands interfaces)CommandBus(Bus commands)ServiceLocator(Application system)