netatmo-algo/src/bounding_box.cpp

18 lines
441 B
C++

#include "bounding_box.h"
namespace freling {
int BoundingBox::area() const {
return width * height;
}
bool BoundingBox::contains(int x, int y) const {
return this->x <= x and x <= this->x + this->width and this->y <= y and
y <= this->y + this->height;
}
bool BoundingBox::operator==(const BoundingBox& b) const {
return x == b.x and y == b.y and width == b.width and height == b.height;
}
} // namespace freling