Beispiel #1
0
 public AutomatonBuilder EndState()
 {
     if (stateBuilder == null)
     {
         throw new InvalidOperationException("State is not prepared");
     }
     states.Add(stateBuilder.Build());
     stateBuilder = null;
     return(this);
 }
Beispiel #2
0
 public AutomatonBuilder BeginState(string id, [CanBeNull] string title = null)
 {
     if (stateBuilder != null)
     {
         throw new InvalidOperationException("Preparing of state already started");
     }
     stateBuilder = new StateBuilder();
     stateBuilder.WithId(id);
     stateBuilder.WithTitle(title);
     return(this);
 }