org.haphazard.dice
Class Die

java.lang.Object
  extended byorg.haphazard.dice.Die

public class Die
extends java.lang.Object

A small class denoting a die


Constructor Summary
Die(int sides)
          Creates a new instance of Die
 
Method Summary
 int roll()
          Rolls the created die
static int roll(int sides)
          Static convenience function to roll a die quickly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Die

public Die(int sides)
Creates a new instance of Die

Parameters:
sides - The number of sides of the die
Method Detail

roll

public int roll()
Rolls the created die

Returns:
int The result of the roll

roll

public static int roll(int sides)
Static convenience function to roll a die quickly

Parameters:
sides - The number of sides on the die to roll
Returns:
The result of the roll