-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Refactor the sentinel logic #201
Conversation
Reviewer's Guide by SourceryThis PR refactors the sentinel logic in the SentinelModule by breaking down the large onTickModule method into smaller, more focused methods. The changes improve code readability and maintainability by extracting complex logic into separate methods and introducing constants for magic numbers. Updated class diagram for SentinelModuleclassDiagram
class SentinelModule {
- Location lastSentinelLocation
- static double MAX_DISTANCE_LIMIT
- static int MIN_SENTINEL_HEALTH
- static double SPEED_MULTIPLIER
- JLabel label
+ void onTickModule()
+ void attackLogic()
+ void followSameMapLogic()
+ void noSentinelLogic()
+ boolean isAttacking()
+ void changeTarget(Entity target)
+ boolean isOurPet(Entity target)
+ Entity getTargetFromAttackerModules()
+ Entity getSentinelTarget()
+ boolean isSentinelValid()
+ boolean hasSentinel()
+ boolean isPotentialSentinel(Player ship)
+ boolean isTaggedSentinel(Player ship)
+ void goToGroup()
+ boolean isGroupMemberValid(eu.darkbot.api.game.group.GroupMember m)
+ void acceptGroupSentinel()
+ double getRadius(Lockable target)
+ void npcMove()
+ void setNPCConfig(Location direction)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @dm94 - I've reviewed your changes - here's some feedback:
Overall Comments:
- The
Boolean.TRUE.equals(runConfigInCircle.getValue())
check is unnecessarily verbose - a simple boolean comparison would be clearer here since getValue() presumably returns a boolean
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Refactor the sentinel logic by extracting and organizing methods to improve code readability and maintainability. Update the plugin version to 2.3.6 beta 1.
Enhancements:
Chores: