//----------------------------------------------------------------------
// SPECIFICATION FILE (rectangle.H)
//
// Exports the Rectangle class.
//----------------------------------------------------------------------

#include "bool.H"

class Rectangle {
public:
    //------------------------------------------------------------------
    // POST:  All data members initialized to zero
    //-----------------------------------------------------------------
    Rectangle();				// Default Constructor

    //------------------------------------------------------------------
    // POST:  Data members set to specified values
    //-----------------------------------------------------------------
    Rectangle(int, int, int, int, float);	// Constructor

    //------------------------------------------------------------------
    // POST:  FCTVAL == area of rectangle
    //-----------------------------------------------------------------
    int Area() const;

    //------------------------------------------------------------------
    // POST:  FCTVAL == rectangle's value data member
    //-----------------------------------------------------------------
    float Value() const;

    //------------------------------------------------------------------
    // POST: FCTVAL == TRUE if the two rectangles overlap
    // Note: It might be easier to write code that determines whether
    // 	     the rectangles do NOT overlap, then return the inverse.
    //-----------------------------------------------------------------
    friend Boolean Overlap(Rectangle, Rectangle);

    //------------------------------------------------------------------
    // POST:  FCTVAL == rectangle formed by intersecting the two input
    // 	      rectangles.  The value field of the new rectangle is the
    //	      product of the input rectangles' values.  If no overlap 
    //	      exists, output rectangle's data members are all zero.
    //-----------------------------------------------------------------
    friend Rectangle Intersection(Rectangle, Rectangle);

private:
    int lowX;		// X-coordinate of left side
    int lowY;		// Y-coordinate of bottom
    int highX;		// X-coordinate of right side
    int highY;		// Y-coordinate of top
    float value;	// value associated with rectangle
};

