mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-20 07:13:50 +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>(
|
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
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user