import java.awt.*;

/**
  *This is the top level class for any class participating in the Game framework
  *Each object has a Bounding Box and a Bitmap
  *@author John D. McGregor
  *@version 1.0
  */ 
public class ArcadeGameObject{
	protected Image _bitmap;
	protected Rectangle _boundingBox;
	protected Dimension _extent;

	/**
	  *The top level constructor is empty
	  */
	ArcadeGameObject(){
	}

	/**
	  *@return the bitmap for the Object
	  */
	public Image getBitMap(){
		return _bitmap;
	}

	/**
	  *@return the Bounding Box of the Object
	  */
	public Rectangle getBoundingBox(){
		return _boundingBox;
	}

	/**
	  *This method computes a Bounding Box for the Object
	  *@param upperLeftCorner the point for the corner of the Object
	  *@param newExtent the width and heigth of the Object
	  *post: a Bounding Box has been instantiated
	  */
	protected void newBoundingBox(Point upperLeftCorner, Dimension newExtent){
		_boundingBox = new Rectangle(upperLeftCorner, newExtent);
	}

	/**
	  *Returns whether the provided point is contained within the 
	  *Bounding Box of the Object
	  *@param location A point to be tested for containment
	  *@return whether the provided point is contained within the 
	  *Bounding Box of the Object
	  */
	public boolean isContained(Point location){
		return _boundingBox.contains(location);
	}

}