allow state machine to check if we are in a state.. taking into account child / parent states.
MODIFY
WalletWasabi.Fluent/State/StateMachine.cs
WalletWasabi.Fluent/State/StateMachine.cs
@@ -13,6 +13,11 @@ public class StateMachine<TState, TTrigger> where TTrigger : Enum where TState :
public TState State => _currentState.StateId;
+ public bool IsInState(TState state)
+ {
+ return _currentState.StateId.Equals(state) || (_currentState.Parent?.StateId.Equals(state) ?? false);
+ }
+
public StateMachine(TState initialState)
{
_states = new Dictionary<TState, StateContext>();

allow state machine to check if we are in a state.. taking into account child / parent states.