/* RollDice class for rolling dice
 * Author: CPSC 111 Jan 2010 class
 * Date: Wed 27 Jan 2010
 *
 * Start of tester for Die2/Die3 classes. 
 *
 * We found that we do not need to import Die2 in order to have it
 * used, since our CLASSPATH is set correctly.
 * 
 * We also found that it's not safe to directly access the numSides
 * field, rather than using the setSides method. We then made that
 * field private in the Die3 class.

 */

import java.util.Scanner;

public class RollDice2
{
    public static void main ( String [] args)
    {
	Die3 myDie = new Die3();
	// testing that roll does the right thing even before we use setSides
	// this call is safe because Die constructor has a backstop value of 6
	int roll1 = myDie.roll();

	System.out.println("How many sides do you want?");
	// need a Scanner
	Scanner scanThing = new Scanner(System.in); 
	int a = scanThing.nextInt();
        // continuing on from this point on Wednesday

	//myDie.numSides = a; 
        //we should not try to access private fields directly, they might change!!

	// this call uses the value we asked the user to enter
	// testing that setSides does the right thing
	myDie.setSides(a);
	int roll2 = myDie.roll();
	System.out.println("RollDice2: first roll was " + roll1 +
			   " second roll was " + roll2);
    }
}


