/// <summary>
 /// Records data about current state.
 /// </summary>
 /// <param name="elements">Array of sms elements.</param>
 internal void Add(params IStateElement[] elements)
 {
     SmsStateKey key = new SmsStateKey( elements.Select(e => e.GetState()).ToList() );
     SmsState currentState = SmsStates.FirstOrDefault(state => state.Key.Equals(key));
     if (currentState == null)
     {
         SmsState newState = new SmsState(key);
         currentState = newState;
         SmsStates.Add(newState);
     }
     ++currentState;
     AddTransition(currentState);
     RecordTargetStatistics(currentState);
     previousState = currentState;
 }
Ejemplo n.º 2
0
 public SmsState(SmsStateKey key)
 {
     this.Key = key;
     this.Code = CodeBuilder();
 }