So, I'll describe my problem. User enters a command. I need to process that command and run a specific function accordingly.
I used a switch statement for finding what command was entered by user, but I think that it was getting rather messy. Should I keep going with this approach?
I decided to create a class for every possible command, put them into an array and, instead of switch statement, use a loop to check if any of the commands fits and call the function stored in that command object. At the moment I have about 10 commands implemented, but the number will grow.
Creating a new file for every new command class looks really bothersome and possibly messy, so I wonder if there is a better way to achieve what I want or perhaps there is a better way to implement everything?