-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fixed Birthday Anniversary Events, Added Employment Anniversary Events #4886
Conversation
Fixed birthday anniversary events to actually declare when a character has a birthday (previously we were incorrectly only checking whether today's date matched the characters literal date of birth, whoops). Renamed `p` to `person` in the `processNewDayPersonnel` method to improve code readability. Added detailed Javadoc comments to explain the daily tasks performed on each active person for better maintenance and understanding.
|
||
// Anniversaries | ||
if ((p.getRank().isOfficer()) || (!getCampaignOptions().isAnnounceOfficersOnly())) { | ||
if ((p.getBirthday().isEqual(getLocalDate())) && (campaignOptions.isAnnounceBirthdays())) { | ||
LocalDate birthday = person.getBirthday(); |
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.
Non-refactoring changes, in this file, start here
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4886 +/- ##
============================================
- Coverage 10.46% 10.44% -0.02%
+ Complexity 6014 6002 -12
============================================
Files 953 953
Lines 132794 132856 +62
Branches 19318 19329 +11
============================================
- Hits 13898 13878 -20
- Misses 117544 117626 +82
Partials 1352 1352 ☔ View full report in Codecov by Sentry. |
Introduced recruitment anniversary notifications and related configurations. Updated methods to use `getDateOfBirth` for birthday data extraction to enhance clarity.
@@ -1352,10 +1338,20 @@ public void setBirthday(final LocalDate birthday) { | |||
* | |||
* @return a LocalDate representing the person's date of birth | |||
*/ | |||
public LocalDate getBirthday() { | |||
public LocalDate getDateOfBirth() { |
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.
More non-refactoring changes in this class
@@ -19,17 +19,6 @@ | |||
*/ |
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.
This Class has non-refactoring changes (introduction of a new campaign option)
@@ -18,43 +18,6 @@ | |||
*/ |
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.
This Class has non-refactoring changes (introduction of a new campaign option)
Updated method names in various files to use `setDateOfBirth` instead of `setBirthday` to enhance clarity and consistency throughout the codebase. This change involved updating method calls and documentation comments accordingly.
# Conflicts: # MekHQ/src/mekhq/campaign/Campaign.java # MekHQ/src/mekhq/campaign/CampaignOptions.java
Fixed birthday anniversary events to actually declare when a character has a birthday (previously we were incorrectly only checking whether today's date matched the characters literal date of birth, whoops).
Added an anniversary event that announces how many years it has been since the character was recruited by the campaign.
Renamed
p
toperson
in theprocessNewDayPersonnel
method to improve code readability.Renamed
getBirthday
&setBirthday
in thePerson
class togetDateOfBirth
/setDateOfBirth
to make it clearer that these method concern the day the character was born and not their annual birthday.Added detailed JavaDoc comments to explain the daily tasks performed on each active person for better maintenance and understanding.