public static IGangCommandExecutor <TStateData> RegisterHandler <TStateData, TCommandData>( this IGangCommandExecutor <TStateData> executor, Func <GangCommand <TCommandData>, GangState <TStateData> > action ) where TStateData : class, new() where TCommandData : class { return(executor.RegisterHandler <TCommandData>( GangCommandHandler <TStateData> .From(action) )); }
public static IGangCommandExecutor <TStateData> RegisterHandler <TStateData, TCommandData>( this IGangCommandExecutor <TStateData> executor, IGangCommandHandler <TStateData, TCommandData> handler ) where TStateData : class, new() where TCommandData : class { return(executor.RegisterHandler <TCommandData>( GangCommandHandler <TStateData> .From(handler) )); }