Exemplo n.º 1
0
        public FSM47 <StateEnum, EventEnum> On(EventEnum eventName)
        {
            if (!_Events.ContainsKey(eventName))
            {
                throw new InvalidOperationException("Event named " + eventName + " not declared in class constructor.");
            }

            _BuildEvent = _Events[eventName];

            return(this);
        }
Exemplo n.º 2
0
        public FSM47 <StateEnum, EventEnum> In(StateEnum stateName)
        {
            if (!_States.ContainsKey(stateName))
            {
                throw new InvalidOperationException("Unable to find key " + stateName + " in States.");
            }

            FinalizePreviousActions();

            _BuildState = _States[stateName];

            _BuildEvent = null;

            return(this);
        }
Exemplo n.º 3
0
        public FSM35 On(string eventName)
        {
            if (string.IsNullOrEmpty(eventName))
            {
                throw new InvalidOperationException("Parameter eventName may not be null or empty.");
            }

            if (!_Events.ContainsKey(eventName))
            {
                throw new InvalidOperationException("Event named " + eventName + " not declared in class constructor.");
            }

            _BuildEvent = _Events[eventName];

            return(this);
        }
Exemplo n.º 4
0
 public FSMAction(FSMState <StateEnum> initialState, FSMEvent <EventEnum> fsmEvent, FSMState <StateEnum> finalState)
 {
     _InitialState = initialState;
     _Event        = fsmEvent;
     _FinalState   = finalState;
 }