public AutomatonBuilder EndState() { if (stateBuilder == null) { throw new InvalidOperationException("State is not prepared"); } states.Add(stateBuilder.Build()); stateBuilder = null; return(this); }
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); }