//Android/br.com.arch.toolkit.android.statemachine/SceneStateMachine
[android]
class SceneStateMachine : StateMachine<SceneStateMachine.State>
Implementation of StateMachine This implementation uses the Scene framework to make State transitions
| Â | Â |
|---|---|
| SceneStateMachine | [android] constructor() |
| Name | Summary |
|---|---|
| State | [android] class State : StateMachine.State Represents a single state in a SceneStateMachine. |
| Name | Summary |
|---|---|
| config | [android] val config: StateMachine.Config The configuration for this state machine. |
| isStarted | [android] var isStarted: Boolean Indicates whether the machine has been started. |
| Name | Summary |
|---|---|
| addState | [android] fun addState(key: Int, state: SceneStateMachine.State): StateMachine<SceneStateMachine.State> Adds a new state to the machine. |
| changeState | [android] fun changeState(stateKey: Int, forceChange: Boolean = false, onChangeState: (Int) -> Unit? = config.onChangeState) Changes the current state of the machine. |
| config | [android] inline fun config(configuration: StateMachine.Config.() -> Unit) Provides a DSL-like way to configure the StateMachine.Config. |
| getCurrentStateKey | [android] fun getCurrentStateKey(): Int Returns the key of the current state. |
| newStateInstance | [android] open override fun newStateInstance(): SceneStateMachine.State Creates a new instance of the specific state type. |
| restoreInstanceState | [android] fun restoreInstanceState(savedInstanceState: ERROR CLASS: Symbol not found for Bundle??): StateMachine<SceneStateMachine.State> Restores the state of the machine from a Bundle. |
| saveInstanceState | [android] fun saveInstanceState(): android/os/Bundle Saves the current state of the machine into a Bundle. |
| setup | [android] inline fun setup(func: StateMachine<SceneStateMachine.State>.() -> Unit) Configures and starts the StateMachine. |
| shutdown | [android] fun shutdown() Shuts down the state machine, clearing states and resetting configuration. |
| start | [android] fun start() Starts the state machine. This must be called after all states are added and initial configuration is set. |
| state | [android] inline fun state(key: Int, stateConfig: SceneStateMachine.State.() -> Unit): StateMachine<SceneStateMachine.State> Adds a new state to the StateMachine using a DSL-like syntax. |