コード例 #1
0
        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);
        }
コード例 #2
0
 private static bool IsTransitionAvailable(List <StateTransitionDef <T> > transitions, StateTransitionDef <T> newState)
 {
     return(transitions.Any(x => x.CurrentStatus.Equals(newState.CurrentStatus)));
 }
コード例 #3
0
 public bool IsTransitionAvailable(StateTransitionDef <T> newState)
 {
     return(IsTransitionAvailable(AllTransitions.ToList(), newState));
 }