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.
3.9 KiB
3.9 KiB