StateConfiguration

Configuration for a specific state in the state machine.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
inline fun <T : E> on(noinline configuration: EventHandler<S, E>.() -> Unit)

Defines how to handle a specific event using reified generics. Multiple handlers can be registered for the same event type. When an event is processed, handlers are evaluated in registration order, and the first handler whose guard passes will be executed.

fun <T : E> on(eventClass: KClass<T>, configuration: EventHandler<S, E>.() -> Unit)

Defines how to handle a specific event in this state. Multiple handlers can be registered for the same event type. When an event is processed, handlers are evaluated in registration order, and the first handler whose guard passes will be executed.

Link copied to clipboard
fun onEnter(action: (state: S) -> Unit)

Defines an action to run when entering this state.

Link copied to clipboard
fun onExit(action: (state: S) -> Unit)

Defines an action to run when exiting this state.