#include "Rectangle.h"

Rectangle::Rectangle(const Point& bottomLeft, const Point& topRight)
    : mBottomLeft(bottomLeft)
{
    mHeight = mBottomLeft.getDeltaY(topRight);
    mWidth = mBottomLeft.getDeltaX(topRight);
}

Rectangle::Rectangle(const Point& bottomLeft, double width, double height)
    : mBottomLeft(bottomLeft),
      mHeight(height),
      mWidth(width)
{

}

Rectangle Rectangle::getBounds() const
{
    return Rectangle(mBottomLeft, Point(mBottomLeft, mWidth, mHeight));
}

void Rectangle::sample(Grid<unsigned char>* grid) const
{

}

double Rectangle::getHeight() const
{
    return mHeight;
}

double Rectangle::getWidth() const
{
    return mWidth;
}

const Point& Rectangle::getLocation() const
{
    return mBottomLeft;
}

Rectangle::Bounds Rectangle::getSize() const
{
    return {mWidth, mHeight};
}
