Exemple #1
0
 /// <summary>
 /// Cambia de estado.
 /// </summary>
 public void SetState <T>() where T : IStateMono
 {
     for (int i = 0; i < _states.Count; i++)
     {
         if (_states[i].GetType() == typeof(T))
         {
             _currentState.StateSleep();
             _currentState = _states[i];
             _currentState.StateAwake();
         }
     }
 }
Exemple #2
0
 public void SetStateByName(string name)
 {
     for (int i = 0; i < _states.Count; i++)
     {
         if (_states[i].GetStateName() == name)
         {
             _currentState.StateSleep();
             _currentState = _states[i];
             _currentState.StateAwake();
         }
     }
 }