java.lang.Object
org.metacosm.framework.random.DiceDistributionLaw
- All Implemented Interfaces:
- DistributionLaw, org.metacosm.framework.persistence.Persistent, java.io.Serializable
- public class DiceDistributionLaw
- extends java.lang.Object
- implements DistributionLaw
Rolls the given number of dice with the given number of faces.
Example: dice(3,6) = 3D6
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nbDice
private int nbDice
nbFaces
private int nbFaces
type
private java.lang.Class type
DiceDistributionLaw
public DiceDistributionLaw(java.lang.Class type,
int nbDice,
int nbFaces)
nextValue
public java.lang.Object nextValue()
- Rolls dice.
- Specified by:
nextValue in interface DistributionLaw
save
public void save(java.io.OutputStream os)
throws java.io.IOException
- Description copied from interface:
org.metacosm.framework.persistence.Persistent
- Saves on the stream.
- Specified by:
save in interface org.metacosm.framework.persistence.Persistent
load
public void load(java.io.InputStream is)
throws java.io.IOException
- Description copied from interface:
org.metacosm.framework.persistence.Persistent
- Loads from the stream.
- Specified by:
load in interface org.metacosm.framework.persistence.Persistent