
commonMain.com.toxicbakery.kfinstatemachine.IStateMachine.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kfin-metadata Show documentation
Show all versions of kfin-metadata Show documentation
Kotlin library for creating finite state machines.
The newest version!
package com.toxicbakery.kfinstatemachine
import kotlin.reflect.KClass
/**
* State machine interface that requires the ability to transition finite states.
*/
interface IStateMachine {
/**
* Current state of the machine.
*/
val state: S
/**
* Transitions available to the current state.
*/
val transitions: Set>
/**
* Transition the machine.
*/
fun transition(transition: T)
/**
* Get the transition required to move to a given state.
*/
fun transitionsTo(targetState: S): Set>
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy