Interface ICommandHandler<T>
- Namespace
- TDMaker.Core
- Assembly
- TDMaker.Core.dll
Handles an exact custom command type without reflection or dynamic dispatch generation in the tick.
public interface ICommandHandler<T> where T : class, ICommand
Type Parameters
T
Examples
sim.RegisterCommandHandler(new SetStanceHandler()); // implements ICommandHandler<SetStance>
Methods
Handle(Simulation, T)
Returns None on success or the rejection reason. Commands must be immutable.
CommandFailure Handle(Simulation simulation, T command)
Parameters
simulationSimulationcommandT