Beispiel #1
0
        public IEnumerable <State <TStateModel> > AvailableStates(TStateModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            return(stateMachine.AvailableStates(model));
        }
Beispiel #2
0
        /// <summary>
        ///     Returns the available states from the current one on a model, given a state machine
        /// </summary>
        /// <typeparam name="TStateModel"></typeparam>
        /// <param name="model">model containing current state</param>
        /// <param name="stateMachine">state machine to process with</param>
        /// <returns></returns>
        public static IEnumerable <State <TStateModel> > AvailableStates <TStateModel>(this IStateModel model,
                                                                                       IStateMachine <TStateModel> stateMachine) where TStateModel : IStateModel
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (stateMachine == null)
            {
                throw new ArgumentNullException("stateMachine");
            }

            return(stateMachine.AvailableStates((TStateModel)model));
        }