/************************************************** ************
Not sure if my second constructor is working properly please help. It is intended to be copy and used to sort the die in yahtzee so i could use it for checking 3 of a kind. 4 of a kind. 5 of a kind. Yahtzee. and full house on a different java class.
************************************************** ************/
public class Dice
{
Die [] dice;
Random gen;
/************************************************** ************
The constructor uses a random generator to build each die.
The number of Die objects is passed as a parameter.
@param gen The random generator
@param num The number of die objects
************************************************** ************/
public Dice(Random gen, int num)
{
this.gen = gen;
dice = new Die[num];
for (int ii = 0; ii < dice.length; ii++)
{
dice[ii] = new Die(gen);
}
}
/************************************************** ************
This copy constructor returns an identical set of dice to
the parameter. This is used to create a set of dice whose
order can be changed from the original.You should use the
Die constructor that creates a die with the same face value
as the original for each of the Die in the set.
@param dice The Dice object to copy
************************************************** ************/
public Dice(Dice dice)
{
for(int ii = 0; ii < dice.getSize(); ii++)
{
this.dice[ii] = new Die(new Random());
}
// check me
}