mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-06-01 23:45:28 +00:00
13 lines
398 B
Kotlin
13 lines
398 B
Kotlin
package dev.inmo.micro_utils.fsm.common
|
|
|
|
/**
|
|
* Default realization of states handler
|
|
*/
|
|
fun interface StatesHandler<I : State, O: State> {
|
|
/**
|
|
* Main handling of [state]. In case when this [state] leads to another [State] and [handleState] returns not null
|
|
* [State] it is assumed that chain is not completed.
|
|
*/
|
|
suspend fun StatesMachine<in O>.handleState(state: I): O?
|
|
}
|