mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-22 08:37:14 +00:00
one more fix
This commit is contained in:
parent
eb78f21eec
commit
494812a660
@ -7,7 +7,7 @@ import kotlin.reflect.KClass
|
||||
|
||||
class FSMBuilder<T : State>(
|
||||
var statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
|
||||
val fsmBuilder: (states: List<CheckableHandlerHolder<T, T>>, statesManager: StatesManager<T>) -> StatesMachine<T> = { states, statesManager ->
|
||||
val fsmBuilder: (statesManager: StatesManager<T>, states: List<CheckableHandlerHolder<T, T>>) -> StatesMachine<T> = { statesManager, states ->
|
||||
StatesMachine(
|
||||
statesManager,
|
||||
states
|
||||
@ -49,10 +49,10 @@ class FSMBuilder<T : State>(
|
||||
}
|
||||
|
||||
fun build() = fsmBuilder(
|
||||
statesManager,
|
||||
states.toList().let { list ->
|
||||
defaultStateHandler ?.let { list + it.holder { true } } ?: list
|
||||
},
|
||||
statesManager
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user