Skip to content

Commit 7c81634

Browse files
author
rlovely
committed
Adding return this to AddTransitionTo to allow chaining methods
1 parent 46a2fdf commit 7c81634

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

StateMachine/RoadieRichStateMachine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<RepositoryType>git</RepositoryType>
1414
<Authors>RoadieRich</Authors>
1515
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
16-
<Version>1.0.4</Version>
16+
<Version>1.0.5</Version>
1717
</PropertyGroup>
1818

1919
<ItemGroup>

StateMachine/State.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ public abstract class State : IDisposable
1414
/// <param name="to">state to transition to</param>
1515
/// <param name="condition">condition to transition. Evaluated each time <see cref="Inner(Dictionary{string, dynamic})"/> is run. If true, the state machine moves to the associated state. Use <c>null</c> to always transition.</param>
1616
/// <remarks>Transition conditions are evaulated in the order they are added.</remarks>
17-
public void AddTransitionTo(State to, TransitionConditionDelegate? condition)
17+
public State AddTransitionTo(State to, TransitionConditionDelegate? condition)
1818
{
1919
transitions.Add(new Transition(to, condition));
20+
return this;
2021
}
2122

2223
internal State RunAndGetNextState(int delay, IDictionary<string, dynamic> vars)

0 commit comments

Comments
 (0)