-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
591 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net45;netstandard2.0;netstandard2.1;</TargetFrameworks> | ||
<AssemblyName>FluentStateMachine</AssemblyName> | ||
<RootNamespace>FluentStateMachine</RootNamespace> | ||
<SignAssembly>true</SignAssembly> | ||
<AssemblyOriginatorKeyFile>..\FluentStateMachine.snk</AssemblyOriginatorKeyFile> | ||
<AssemblyVersion>1.0.0</AssemblyVersion> | ||
<FileVersion>1.0.0</FileVersion> | ||
<Version>1.0.0</Version> | ||
|
||
<Company></Company> | ||
<Authors>Leonid Salavatov</Authors> | ||
<Copyright>Leonid Salavatov 2021</Copyright> | ||
<PackageId>FluentStateMachine</PackageId> | ||
<Product>FluentStateMachine</Product> | ||
<Title>FluentStateMachine</Title> | ||
<Description>.NET Finite-state machine (FSM) with a fluent interface</Description> | ||
<PackageTags>fluent statemachine finitestatemachine fsm dotnet</PackageTags> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageProjectUrl>https://github.com/mustaddon/StateMachine</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/mustaddon/StateMachine</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<NeutralLanguage /> | ||
<PackageReleaseNotes></PackageReleaseNotes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'"> | ||
<DefineConstants>NET45</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace FluentStateMachine | ||
{ | ||
internal static class FrameworkExt | ||
{ | ||
|
||
#if NET45 | ||
public static readonly Task CompletedTask = Task.FromResult(false); | ||
#else | ||
public static readonly Task CompletedTask = Task.CompletedTask; | ||
#endif | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
|
||
namespace FluentStateMachine | ||
{ | ||
public static class FsmBuilderExtensions | ||
{ | ||
public static FsmBuilder<TState, TEvent> OnReset<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmResetArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnReset(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnExit<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmExitArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnExit(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnEnter<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmEnterArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnEnter(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnJump<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmEnterArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnJump(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnTrigger<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmTriggerArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnTrigger(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnFire<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmTriggerArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnFire(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnComplete<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmCompleteArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnComplete(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
public static FsmBuilder<TState, TEvent> OnError<TState, TEvent>(this FsmBuilder<TState, TEvent> builder, | ||
Action<FsmErrorArgs<TState, TEvent>> action) | ||
{ | ||
return builder.OnError(x => { action(x); return FrameworkExt.CompletedTask; }); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.