refactor: divide command switch into smaller methods
This pull request refactors the Command
class to improve code readability and maintainability by extracting command actions into separate methods. Additionally, it includes minor improvements to PlayerList
and MatchList
classes.
Refactoring Command Class:
- Extracted command actions into private methods for better readability and maintainability (
src/Command.java
). 1(diffhunk://#diff-55b91a5d613b340ad9761c4acbb61d8f43c5ebbc122ff2bc5c054f38441e92cdL26-R141) 2(diffhunk://#diff-55b91a5d613b340ad9761c4acbb61d8f43c5ebbc122ff2bc5c054f38441e92cdL96-L104)
PlayerList Improvements:
- Improved the
remove
method to store the result of the removal operation and assert on the result (src/PlayerList.java
). - Implemented the
isEmpty
method to check if the player list is empty (src/PlayerList.java
).
MatchList Improvements:
- Removed redundant print statements from the
show
method (src/MatchList.java
).