Exemplo n.º 1
0
 public void Transition(StateTransition transition)
 {
     if (transition == null)
     {
         return;
     }
     if (transition.From == CurrentState)
     {
         LastTransition = transition;
         CurrentState   = transition.To;
     }
 }
Exemplo n.º 2
0
        public void Transition(string name)
        {
            StateTransition transition = null;

            foreach (var t in Transitions)
            {
                if (t.From == CurrentState && t.Name == name)
                {
                    transition = t;
                    break;
                }
            }
            if (transition != null)
            {
                Transition(transition);
            }
        }
Exemplo n.º 3
0
        public void Transition(string name)
        {
            StateTransition transition = null;

            for (int index = 0; index < Transitions.Length; index++)
            {
                StateTransition p = Transitions[index];
                if (p.From == CurrentState && p.Name == name)
                {
                    transition = p;
                    break;
                }
            }

            if (transition != null)
            {
                Transition(transition);
            }
        }
Exemplo n.º 4
0
 public virtual void AddTrigger(StateMachineTrigger trigger, StateTransition transition)
 {
     Triggers.Add(trigger, transition);
 }
Exemplo n.º 5
0
 public void Transition(StateTransition transition)
 {
     StateMachine.Transition(transition);
 }