KStateMachine / kstatemachine

KStateMachine is a Kotlin DSL library for creating state machines and statecharts.
https://kstatemachine.github.io/kstatemachine/
Boost Software License 1.0
340 stars 19 forks source link

Add parallel states support #15

Closed nsk90 closed 3 years ago

nsk90 commented 3 years ago

done in c1c7a3d7

ShraddhaGade commented 1 year ago

Hi @nsk90 How can I use in my states?? I mean that I have one state and in that state I want make child state to be use Parallelly. AddState(State1){ "run all states here parelle" }

nsk90 commented 1 year ago

Hi, in your case it should be set in State1 base class constructor argument. like this:

object State1 : DefaultState("state1", childMode = ChildMode.PARALLEL)

you can find docs here https://github.com/nsk90/kstatemachine/wiki#parallel-states and some other code usages in tests: https://github.com/nsk90/kstatemachine/blob/master/kstatemachine/src/test/kotlin/ru/nsk/kstatemachine/ParallelStatesTest.kt