Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 776 Bytes

README.md

File metadata and controls

43 lines (30 loc) · 776 Bytes

Stateman

Build Status

Stateman is simple state machine library for .NET languages.

License

MIT License

Installation

dotnet add package Stateman

Usage

class FooState : State
{
}

class BarState : State
{
}
var stateMachine = new StateMachine(new FooState());
stateMachine.Transited += sender => {
    // Raised when state changed.
}

// Transition from FooState to BarState
stateMachine.Transit<FooState, BarState>();

// Transition to previous state.
stateMachine.Previous();

// Transition to next state.
stateMachine.Next();