one more fix

This commit is contained in:
InsanusMokrassar 2021-12-26 21:25:12 +06:00
parent eb78f21eec
commit 494812a660

View File

@ -7,7 +7,7 @@ import kotlin.reflect.KClass
class FSMBuilder<T : State>( class FSMBuilder<T : State>(
var statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), 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( StatesMachine(
statesManager, statesManager,
states states
@ -49,10 +49,10 @@ class FSMBuilder<T : State>(
} }
fun build() = fsmBuilder( fun build() = fsmBuilder(
statesManager,
states.toList().let { list -> states.toList().let { list ->
defaultStateHandler ?.let { list + it.holder { true } } ?: list defaultStateHandler ?.let { list + it.holder { true } } ?: list
}, }
statesManager
) )
} }