All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.toxicbakery.kfinstatemachine.IStateMachine.kt Maven / Gradle / Ivy

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