Skip to content

Instantly share code, notes, and snippets.

@thealmikey
Last active January 21, 2020 02:54
Show Gist options
  • Save thealmikey/8233a3f71b6321b70111b9c9725ad4e7 to your computer and use it in GitHub Desktop.
Save thealmikey/8233a3f71b6321b70111b9c9725ad4e7 to your computer and use it in GitHub Desktop.
import com.tinder.StateMachine
sealed class HumanState {
object PureBliss : HumanState()
object Happy : HumanState()
object Bored : HumanState()
object Sad : HumanState()
}
sealed class HumanAction {
object Entertain : HumanAction()
object GiveLecture : HumanAction()
object Annoy : HumanAction()
object GiveTherapy : HumanAction()
}
sealed class UseResult {
object ReportHappiness : UseResult()
object ReportSadness : UseResult()
object ReportBoredness : UseResult()
object ReportGoodWork : UseResult()
object ReportVibeKiller : UseResult()
}
val emotionalState = StateMachine.create<HumanState, HumanAction, UseResult> {
initialState(HumanState.Bored)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment