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

Fixed Birthday Anniversary Events, Added Employment Anniversary Events #4886

Merged
merged 7 commits into from
Sep 26, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Sep 25, 2024

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 to person in the processNewDayPersonnel method to improve code readability.

Renamed getBirthday & setBirthday in the Person class to getDateOfBirth/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.

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.
@IllianiCBT IllianiCBT added Bug Personnel Personnel-related Issues labels Sep 25, 2024
@IllianiCBT IllianiCBT self-assigned this Sep 25, 2024

// Anniversaries
if ((p.getRank().isOfficer()) || (!getCampaignOptions().isAnnounceOfficersOnly())) {
if ((p.getBirthday().isEqual(getLocalDate())) && (campaignOptions.isAnnounceBirthdays())) {
LocalDate birthday = person.getBirthday();
Copy link
Collaborator Author

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-commenter
Copy link

codecov-commenter commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.44%. Comparing base (c147ec9) to head (bc787b4).
Report is 16 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@IllianiCBT IllianiCBT changed the title Fixed Birthday Anniversary Events Fixed Birthday Anniversary Events, Added Employment Anniversary Events Sep 25, 2024
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() {
Copy link
Collaborator Author

@IllianiCBT IllianiCBT Sep 25, 2024

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 @@
*/
Copy link
Collaborator Author

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 @@
*/
Copy link
Collaborator Author

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)

IllianiCBT and others added 5 commits September 25, 2024 13:20
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
@IllianiCBT IllianiCBT merged commit 0bcab47 into MegaMek:master Sep 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Personnel Personnel-related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants