The entity class includes methods to add, remove, or retrieve potions, as well as access other relevant data associated with each potion. It also allows for clearing each effect applied to the entity. However, it currently lacks a direct way to check if any effect is active.
While it’s possible to check for effects using the existing method that retrieves all effects from an entity, the newly added shorthand method simplifies this check, reducing line complexity and improving code readability.
To enhance the maintainability of the project, new tests have been added to validate this method, along with additional test cases for other related functionalities.
Note If you want to verify the changes, you need to comment out the GAME_EVENTS enum entry in the Tag class otherwise the test in general will fail (that behaviour should be fixed in the future)
Types of changes
What types of changes does your code introduce to this project?
Put an x in the boxes that apply
[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] Documentation Update (if none of the other choices apply)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.
[x] I have read the CONTRIBUTING.md
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added necessary documentation (if appropriate)
Proposed changes
The entity class includes methods to add, remove, or retrieve potions, as well as access other relevant data associated with each potion. It also allows for clearing each effect applied to the entity. However, it currently lacks a direct way to check if any effect is active.
While it’s possible to check for effects using the existing method that retrieves all effects from an entity, the newly added shorthand method simplifies this check, reducing line complexity and improving code readability.
To enhance the maintainability of the project, new tests have been added to validate this method, along with additional test cases for other related functionalities.
Note If you want to verify the changes, you need to comment out theGAME_EVENTS
enum entry in theTag
class otherwise the test in general will fail (that behaviour should be fixed in the future)Types of changes
What types of changes does your code introduce to this project? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.