|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.TargetRoll
public class TargetRoll
Keeps track of a target for a roll. Allows adding modifiers with descriptions, including appending the modifiers in another TargetRoll. Intended for rolls like a to-hit roll or a piloting skill check.
| Field Summary | |
|---|---|
static int |
AUTOMATIC_FAIL
|
static int |
AUTOMATIC_SUCCESS
|
static int |
CHECK_FALSE
|
static int |
IMPOSSIBLE
|
| Constructor Summary | |
|---|---|
TargetRoll()
Creates new TargetRoll |
|
TargetRoll(int value,
java.lang.String desc)
Creates a new TargetRoll with a base value & desc |
|
TargetRoll(int value,
java.lang.String desc,
boolean cumulative)
Creates a new TargetRoll with a base value & desc, which is possibly not cumulative |
|
| Method Summary | |
|---|---|
void |
addModifier(int value,
java.lang.String desc)
|
void |
addModifier(int value,
java.lang.String desc,
boolean cumulative)
|
void |
addModifier(megamek.common.TargetRoll.Modifier modifier)
|
void |
append(TargetRoll other)
Append another TargetRoll to the end of this one |
void |
append(TargetRoll other,
boolean appendNonCumulative)
Append another TargetRoll to the end of this one, possibly ignoring non-cumulative Modifier in the other one |
java.lang.String |
getCumulativePlainDesc()
Returns the description of the first cumulative Modifier |
java.lang.String |
getDesc()
Returns a description of all applicable modifiers |
java.lang.String |
getLastPlainDesc()
Returns the last description found |
java.lang.String |
getPlainDesc()
Returns the first description found |
int |
getValue()
Returns the total value of all modifiers |
java.lang.String |
getValueAsString()
Returns the total value of all modifiers |
void |
removeAutos()
Remove all automatic failures or successes, but leave impossibles intact |
void |
removeAutos(boolean removeImpossibles)
Remove all automatic failures or successes, and possibly also remove impossibles |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int IMPOSSIBLE
public static final int AUTOMATIC_FAIL
public static final int AUTOMATIC_SUCCESS
public static final int CHECK_FALSE
| Constructor Detail |
|---|
public TargetRoll()
public TargetRoll(int value,
java.lang.String desc)
public TargetRoll(int value,
java.lang.String desc,
boolean cumulative)
value - desc - cumulative - | Method Detail |
|---|
public int getValue()
public java.lang.String getValueAsString()
public java.lang.String getDesc()
public java.lang.String getPlainDesc()
public java.lang.String getCumulativePlainDesc()
public java.lang.String getLastPlainDesc()
public void addModifier(int value,
java.lang.String desc)
public void addModifier(int value,
java.lang.String desc,
boolean cumulative)
public void addModifier(megamek.common.TargetRoll.Modifier modifier)
public void append(TargetRoll other)
public void append(TargetRoll other,
boolean appendNonCumulative)
other - appendNonCumulative - public void removeAutos()
public void removeAutos(boolean removeImpossibles)
removeImpossibles - boolean value wether or not
impossibles should be removed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||