de.adom.jade.utils
Class Dice

java.lang.Object
  extended by de.adom.jade.utils.Dice
All Implemented Interfaces:
java.io.Serializable

public class Dice
extends java.lang.Object
implements java.io.Serializable

Defines a class that interprets a dice string of type 'x'd'y'+'z' and can create random numbers derived from that dice string.

See Also:
Serialized Form

Constructor Summary
Dice(java.lang.String representation)
          Defines a die roll by a string representation.
 
Method Summary
 int roll()
          Rolls the defined number of dice and returns an appropriate result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dice

public Dice(java.lang.String representation)
Defines a die roll by a string representation.

Parameters:
representation - the string representation of the die roll
Method Detail

roll

public int roll()
Rolls the defined number of dice and returns an appropriate result.

Returns:
the result gained from rolling the defined number of dice