/*****************************************************************
* Cheese.java
* Programmer: John Hansen
* Last Edited: February 19, 2009
* 
* This class holds the x and y coordinates of a piece of cheese
* and provides a method for dropping it in a random location
*
******************************************************************/

public class Cheese {
	
	//The x-coordinate of the cheese
	private int xLocation;
	
	//The y-coordinate of the cheese
	private int yLocation;
	
	/**
	 * Gets the x-coordinate of the cheese
	 * 
	 * @return x-coordinate of the cheese
	 */
	public int getXLocation(){
		return xLocation;
	}
	
	/**
	 * Gets the y-coordinate of the cheese
	 * 
	 * @return y-coordinate of the cheese
	 */
	public int getYLocation(){
		return yLocation;
	}
	
	/**
	 * Sets the x and y coordinates of the cheese to random values 
	 * within a specified range of ([0:xRange), [28:yRange+28)).
	 * The +28 is specified so that the top of cheese will be at least
	 * 28 pixels below the top of the window, so that we can draw
	 * the success and failure strings.
	 * 
	 * @param xRange The maximum x coordinate for the cheese
	 * @param yRange The maximum y coordinate for the cheese
	 */
	public void dropInRandomSpot(int xRange, int yRange){
		xLocation=(int)(Math.random()*xRange);
		yLocation=(int)(Math.random()*yRange)+28;
	}
	

}
