suspend fun start()

in intellij-plugin/features/ide-onboarding/src/com/jetbrains/edu/uiOnboarding/ZhabaExecutor.kt [64:101]


  suspend fun start(step: ZhabaStepBase) {
    var currentStep = step
    var currentData = step.typed().performStep(project, (animationData ?: return)) ?: return
    var currentTransition: String? = null

    while (true) {
      if (currentTransition == null) {
        currentTransition = runStep(currentStep, currentData)
      }

      val nextStep = graph.move(currentStep, currentTransition)

      if (nextStep == null) {
        if (currentTransition != FINISH_TRANSITION) {
          thisLogger().error("No next step for ${step.stepId} with transition $currentTransition")
        }
        return
      }

      val nextData = nextStep.typed().performStep(project, (animationData ?: return))
      if (nextData == null) {
        currentStep = nextStep
        currentTransition = STEP_UNAVAILABLE_TRANSITION
        continue
      }

      val transitionAnimation = TransitionAnimator.animateTransition(project, (animationData ?: return), currentData, nextData)
      currentTransition = if (transitionAnimation == null) {
        null
      }
      else {
        executeAnimation(transitionAnimation, nextData)
      }

      currentStep = nextStep
      currentData = nextData
    }
  }