Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<LangVersion>latest</LangVersion>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>

<AssemblyVersion>2.3.1</AssemblyVersion>
<AssemblyVersion>2.4.0</AssemblyVersion>

<BaseOutputPath>../../output/$(MSBuildProjectName)</BaseOutputPath>
<Deterministic>true</Deterministic>
Expand Down
Binary file modified docs/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file added docs/images/icon-128x128_MK2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file added docs/images/nuget-state-machine-icon-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nuget-state-machine-icon-chip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nuget-state-machine-icon-minimal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nuget-state-machine-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ You can define the state machine using either the fluent design pattern or stand

### Basic State

![](docs/images/nuget-state-machine-icon-isometric.png)
The basic state exapmle transitions from `State1 -> State2 -> State3`.

```cs
// That's it! Just create the state machine, register states, and run it.
var machine = await new StateMachine<StateId>()
Expand Down Expand Up @@ -57,7 +60,7 @@ public class BasicState1() : BaseState
{
public async Task OnEnter(Context<BasicStateId> context)
{
await Task.Yield(); // Some async work here...
await Task.Yield(); // Your async work here...
context.NextState(Result.Ok);
}
}
Expand All @@ -66,8 +69,9 @@ public class BasicState2() : BaseState
{
public Task OnEnter(Context<StateId> context)
{
// Notice, we did not async/await this method
context.NextState(Result.Ok);
return Task.CompletedTask; // Notice, we did not async/await this method
return Task.CompletedTask;
}
}

Expand All @@ -91,6 +95,8 @@ var uml = machine.ExportUml(includeSubmachines: true);

### Composite States

The following uses the fluent design pattern style, stacking the `.RegisterXXX(...)` methonds ontop of each other with the `RunAsync(...)` method occurring at the end.

```cs
using Lite.StateMachine;

Expand Down
Loading