appccelerate / statemachine

A .net library that lets you build state machines (hierarchical, async with fluent definition syntax and reporting capabilities).
Apache License 2.0
496 stars 129 forks source link

Feature/define initial state at configuration time #53

Closed wtjerry closed 5 years ago

wtjerry commented 5 years ago

Previously to initialize an Active/Passive SM the method Initialize(TState initialState) had to be called. The SM would then remember this initial State but NOT yet transition to it. The transition would only be done once Start() was called.

After this change, the initalState will already have to be configured at definition time via StateMachineDefinitionBuilder.WithInitialState(TState initialStateToUse). The SM will no longer need an Initialize method. Same as before this change, the transition to the initial state would only be done once Start() was called.