Skip to content

Commit

Permalink
Remove @SuppressWarnings annotations and add documentation
Browse files Browse the repository at this point in the history
Removed redundant @SuppressWarnings annotations from multiple classes and enhanced codebase documentation. The changes add clarity to the functionality of classes and methods through JavaDocs, improving maintainability and readability.
  • Loading branch information
IllianiCBT committed Sep 25, 2024
1 parent f1f7c5a commit b6d9d00
Show file tree
Hide file tree
Showing 10 changed files with 357 additions and 76 deletions.
10 changes: 9 additions & 1 deletion MekHQ/src/mekhq/campaign/personnel/divorce/AbstractDivorce.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void setUseRandomPrisonerDivorce(final boolean useRandomPrisonerDivorce)
/**
* This is a standardization method for the divorce surname style to use when a person's spouse
* dies.
*
* <p>
* TODO : I should be part of AbstractDeath
*
* @param campaign the campaign the person is in
Expand Down Expand Up @@ -300,6 +300,14 @@ public void divorce(final Campaign campaign, final LocalDate today, final Person
MekHQ.triggerEvent(new PersonChangedEvent(origin));
}

/**
* Processes divorce events that occur as part of a character's background.
*
* @param campaign the campaign associated with the divorce
* @param today the current date of the divorce
* @param origin the person whose background is being divorced
* @param style the splitting surname style to be applied
*/
public void backgroundDivorce(final Campaign campaign, final LocalDate today, final Person origin,
final SplittingSurnameStyle style) {
final Person spouse = origin.getGenealogy().getSpouse();
Expand Down
21 changes: 19 additions & 2 deletions MekHQ/src/mekhq/campaign/personnel/divorce/RandomDivorce.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,42 @@
import mekhq.campaign.CampaignOptions;
import mekhq.campaign.personnel.enums.RandomDivorceMethod;

/**
* The {@link RandomDivorce} class is an implementation of the {@link AbstractDivorce} class that
* represents a divorce method based on random chance.
* The divorce outcome is determined by rolling a die with a specified number of sides.
*/
public class RandomDivorce extends AbstractDivorce {
//region Variable Declarations
private int divorceDiceSize;
//endregion Variable Declarations

//region Constructors
/**
* The {@link RandomDivorce} class is an implementation of the {@link AbstractDivorce} class that
* represents a divorce method based on random chance.
*/
public RandomDivorce(final CampaignOptions options) {
super(RandomDivorceMethod.DICE_ROLL, options);
setDivorceDiceSize(options.getRandomDivorceDiceSize());
}
//endregion Constructors

/**
* Retrieves the size of the divorce dice.
*
* @return The size of the divorce dice as an integer.
*/
//region Getters/Setters
@SuppressWarnings(value = "unused")
public int getDivorceDiceSize() {
return divorceDiceSize;
}

@SuppressWarnings(value = "unused")
/**
* Sets the size of the divorce dice.
*
* @param divorceDiceSize the size of the dice used to determine divorce outcomes
*/
public void setDivorceDiceSize(final int divorceDiceSize) {
this.divorceDiceSize = divorceDiceSize;
}
Expand Down
Loading

0 comments on commit b6d9d00

Please sign in to comment.