<@U8SPC0ZTQ> When you have so many `if`s like that...
# codereview
@Ayden When you have so many `if`s like that, it is often wise to consider a state machine approach instead.
May I know how to do so?
It's not really a Kotlin-specific question and a lot depends on your problem. You'll find lots of information if you Google "state machine" or "finite state machine". You can implement a state machine with just
statements as you have done, but once the complexity reaches a certain level its usually better to abstract the state behavior. Try searching also for "state pattern".