Package mekhq.campaign.parts
Interface Dice
- All Known Implementing Classes:
CampaignDice
public interface Dice
The source of random rolls for part destruction checks.
Parts reach it through Campaign.getDice() rather than calling MegaMek's Compute directly, so
that a test can supply a fixed sequence of rolls and pin down which parts survive. The default implementation,
CampaignDice, delegates to Compute exactly as the parts did before.
-
Method Summary
-
Method Details
-
d6
int d6(int numberOfDice) Rolls a number of six-sided dice and returns their total.- Parameters:
numberOfDice- how many six-sided dice to roll- Returns:
- the sum of the dice
-
randomInt
int randomInt(int maximumValue) Returns a random integer from0(inclusive) tomaximumValue(exclusive).- Parameters:
maximumValue- the exclusive upper bound- Returns:
- a random integer between
0andmaximumValue - 1
-