Skip to content
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 redundant functions 'weapon_overlay' and 'magic_overlay' #1

Open
MujahidElmaki opened this issue Jan 2, 2024 · 2 comments · May be fixed by #2
Open

Refactor redundant functions 'weapon_overlay' and 'magic_overlay' #1

MujahidElmaki opened this issue Jan 2, 2024 · 2 comments · May be fixed by #2
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@MujahidElmaki
Copy link
Owner

MujahidElmaki commented Jan 2, 2024

Issue Description

The functions weapon_overlay and magic_overlay in our codebase perform similar tasks but are implemented separately. This redundancy can lead to code maintainability issues and makes the codebase less efficient. Both functions create a background rectangle and then display a weapon or magic graphic in the center of this rectangle.

Suggested Solution

Refactor these two functions into a single, more generic function that can handle both weapons and magic overlays. This new function should be able to take parameters that define whether it's dealing with a weapon or magic graphic.

Proposed Function Signature

def overlay(self, index, x_coord, y_coord, has_switched, overlay_type):
    # Implementation
@MujahidElmaki MujahidElmaki changed the title Refactor redundant functions Refactor redundant functions 'weapon_overlay' and 'magic_overlay' Jan 2, 2024
@MujahidElmaki MujahidElmaki added good first issue Good for newcomers enhancement New feature or request labels Jan 2, 2024
@code-master-ajay
Copy link

Hi @MujahidElmaki, I am just beginning my open source contribution journey, This looks perfect for that. Can you please assign this to me ?

@MujahidElmaki
Copy link
Owner Author

Hi @MujahidElmaki, I am just beginning my open source contribution journey, This looks perfect for that. Can you please assign this to me ?

Done. Good luck on your journey!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants