protected StateTransitionDef <T> RegisterStatus(T state) { var retVal = _transistions.FirstOrDefault(x => x.CurrentStatus.Equals(state)); if (retVal == null) { retVal = new StateTransitionDef <T>(state); _transistions.Add(retVal); } return(retVal); }
private static bool IsTransitionAvailable(List <StateTransitionDef <T> > transitions, StateTransitionDef <T> newState) { return(transitions.Any(x => x.CurrentStatus.Equals(newState.CurrentStatus))); }
public bool IsTransitionAvailable(StateTransitionDef <T> newState) { return(IsTransitionAvailable(AllTransitions.ToList(), newState)); }