Skip to content

Commit aba1df2

Browse files
authored
Improvement: Added JavaDocs to TargetRollModifier Class & Constructor to Reduce Ambiguity (MegaMek#7491)
As per title. Nothing exciting here. As further action, it might make sense to rename 'TargetRoll' and 'TargetRollModifier' to 'TargetNumber' and 'TargetNumberModifier' to further reduce risk of confusion moving forward. Such confusion was the root cause of MegaMek/mekhq#7713
2 parents 20a0b9a + bd81fe2 commit aba1df2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

megamek/src/megamek/common/TargetRollModifier.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,21 @@
4242
* This class represents individual modifiers for a {@link TargetRoll}. Each modifier has a value, the actual modifier
4343
* like +1 or -2 or one of the finalizers like {@link TargetRoll#AUTOMATIC_FAIL}, a description (attacker jumped) and
4444
* indicates if it is cumulative. Note: This class is immutable.
45+
*
46+
* <p><b>WARNING:</b> it is important to note that this is a modifier to the <b>Target Number</b> and <i>not</i>
47+
* the roll. That means that a {@code positive number} is bad and a {@code negative number} is good.</p>
4548
*/
4649
public record TargetRollModifier(int value, String description, boolean cumulative) implements Serializable {
4750

51+
/**
52+
* Constructs a {@link TargetRollModifier} with the specified value and description.
53+
*
54+
* <p><b>WARNING:</b> it is important to note that this is a modifier to the <b>Target Number</b> and <i>not</i>
55+
* the roll. That means that a {@code positive number} is bad and a {@code negative number} is good.</p>
56+
*
57+
* @param value the numeric value of the modifier
58+
* @param description a description of the modifier's purpose or source
59+
*/
4860
public TargetRollModifier(int value, String description) {
4961
this(value, description, true);
5062
}

0 commit comments

Comments
 (0)