edu.rice.comp440.board
Class Dice

java.lang.Object
  |
  +--edu.rice.comp440.board.Dice

public class Dice
extends java.lang.Object


Field Summary
protected  int die1
           
protected  int die2
           
static int MAX_VALUE
           
static int MIN_VALUE
           
static int NUM_DICE
           
 
Method Summary
static Dice getDice(int i, int j)
          Method which returns a specific dice roll.
 int getDie1()
          Returns the value of the first die
 int getDie2()
          Returns the value of the second die
 boolean isDoubles()
          Returns whether or not the dice are doubles
 void print(java.io.PrintStream out)
          Prints out a gnubg-style text board.
static Dice roll()
          Method which rolls the dice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_VALUE

public static int MIN_VALUE

MAX_VALUE

public static int MAX_VALUE

NUM_DICE

public static int NUM_DICE

die1

protected int die1

die2

protected int die2
Method Detail

getDice

public static Dice getDice(int i,
                           int j)
Method which returns a specific dice roll. The numbers should be the desired roll of the dice (i.e. on the range (1-6) not (0-5)).
Parameters:
die1 - The first die
die2 - The second die

roll

public static Dice roll()
Method which rolls the dice

getDie1

public int getDie1()
Returns the value of the first die
Returns:
the value of the first die

getDie2

public int getDie2()
Returns the value of the second die
Returns:
the value of the first die

isDoubles

public boolean isDoubles()
Returns whether or not the dice are doubles
Returns:
Whether or not the dice are doubles

print

public void print(java.io.PrintStream out)
Prints out a gnubg-style text board.
Parameters:
out - The output stream to write the dice to