#include "bounds.hpp" Bounds::Bounds(const IBoundsOptions &options) : _width(options.width), _height(options.height) { } unsigned int Bounds::width() const { return _width; } void Bounds::width(unsigned int width) { _width = width; } unsigned int Bounds::height() const { return _height; } void Bounds::height(unsigned int height) { _height = height; } CoordsValidation Bounds::validate_coords(const IVector2 &coords) const { if (coords.x() >= _width) { return CoordsValidation::X_HIGH; } if (coords.y() >= _height) { return CoordsValidation::Y_HIGH; } return CoordsValidation::VALID; } const IBounds &Bounds::operator*=(const IBounds &bounds) { _width *= bounds.width(); _height *= bounds.height(); return *this; } const IBounds &Bounds::operator+=(const IBounds &bounds) { _width += bounds.width(); _height += bounds.height(); return *this; } const IBounds &Bounds::operator-=(const IBounds &bounds) { _width -= bounds.width(); _height -= bounds.height(); return *this; }