public virtual void Transfer(StateContext <TState> context) { if (this.CanTransfer(context)) { this.OnTransfer(context); } }
protected virtual void OnFailed(StateContext <TState> context) { throw new InvalidOperationException($"Not supported state transfer from '{context.Origin}' to '{context.Destination}'."); }
protected virtual bool OnTransfer(StateContext <TState> context) { return(true); }
public abstract void OnTrigger(StateContext <TState> context);
protected abstract void OnTransfer(StateContext <TState> context);
public virtual bool CanTransfer(StateContext <TState> context) { return(this.Enabled && context != null && (!context.Origin.Equals(context.Destination))); }