|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.Roll
megamek.common.MMRoll
public class MMRoll
Subclass of the roll tracker for MMRandom entropy sources.
| Field Summary |
|---|
| Fields inherited from class megamek.common.Roll |
|---|
faces, id, min |
| Constructor Summary | |
|---|---|
MMRoll(MMRandom rng)
Most tolls use standard six sided dice. |
|
MMRoll(MMRandom rng,
int max)
Most other rolls have a minimum value of zero. |
|
MMRoll(MMRandom rng,
int count,
int start)
Create a set of virtual dice with the given number of faces that start with the given value. |
|
| Method Summary | |
|---|---|
void |
addRoll(MMRandom rng)
Add the result from the given RNG source. |
int |
getIntValue()
Get the value of the roll. |
java.lang.String |
getReport()
Get a String report that can be parsed to analyse the
roll. |
static void |
main(java.lang.String[] args)
Test harness for this class. |
java.lang.String |
toString()
Get a String containing the roll for each of the virtual
dice. |
| Methods inherited from class megamek.common.Roll |
|---|
output |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MMRoll(MMRandom rng)
rng - - the MMRandom that produces random numbers.
public MMRoll(MMRandom rng,
int max)
rng - - the MMRandom that produces random numbers.max - - the smallest int value that is higher than
all rolls; all rolls will be in the value set [0, max).
public MMRoll(MMRandom rng,
int count,
int start)
rng - - the MMRandom that produces random numbers.count - - the int number of results possible on each
virtual die.start - - the int value that is the start of the
value set of each virtual die.| Method Detail |
|---|
public void addRoll(MMRandom rng)
rng - - the MMRandom that produces random numbers.public int getIntValue()
getIntValue in class Rollint value of the roll.public java.lang.String toString()
String containing the roll for each of the virtual
dice.
toString in class RollString value of the roll.public java.lang.String getReport()
String report that can be parsed to analyse the
roll.
getReport in class RollString details of the roll.public static void main(java.lang.String[] args)
args - - the array of String arguments: first is the
number of rolls (defaults to two), second is number of sides
(defaults to six sides), third is the starting number
(defaults to one for six sided dice, zero for anything else).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||