Optimization and Refactoring of Death Inventory Log Commands#7
Open
Jullius1392 wants to merge 4 commits intoMuqsit:masterfrom
Open
Optimization and Refactoring of Death Inventory Log Commands#7Jullius1392 wants to merge 4 commits intoMuqsit:masterfrom
Jullius1392 wants to merge 4 commits intoMuqsit:masterfrom
Conversation
…entory Log.
Changes made:
1. **onCommand:**
- Reorganize switch logic to improve clarity.
- Moved the "history" case code to a new `executeHistoryCommand` method.
- Added use of `translateGamertags` and `retrievePlayerEntries` directly in the `executeHistoryCommand` method to simplify the logic.
2. **executeRestoreCommand and executeViewCommand:**
- Separate methods have been created for the "restore" and "view" cases respectively.
- Each of these methods performs specific actions, improving the modularity of the code.
- Added a new `retrieveAndApplyLog` method to handle retrieving and applying logs to the player.
- Added a new `retrieveAndDisplayLog` method to handle retrieving and displaying logs to the command sender.
- These changes make the code easier to understand and maintain.
3. **applyLogToPlayer and displayLogToSender:**
- New methods created to encapsulate the logic of applying and displaying records, respectively.
- These methods improve code reuse and facilitate future modifications.
These changes seek to improve the structure and clarity of the code, as well as facilitate future expansions and maintenance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes significant improvements in the management of Death Inventory Log commands. Separate methods have been created for the "history," "restore," and "view" cases, enhancing code modularity and readability. Additionally, specific methods have been added for retrieving and applying logs to the player, as well as for displaying logs to the command sender. These changes aim to ease maintenance and future expansions of the code.
Changes Made:
onCommand).retrieveAndApplyLog).retrieveAndDisplayLog).This pull request is ready for review. Comments and suggestions are appreciated.