Refactor the function to keep an array of commands with requirements that have to be met. Those commands are then cycled over a wrap around index instead of the inflexible switch statement.
Refactor the function to keep an array of commands with requirements that have to be met. Those commands are then cycled over a wrap around index instead of the inflexible switch statement.