#include "bounds.hpp" Bounds::Bounds(BoundsOpts opts) : _width(opts.width), _height(opts.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; } void Bounds::verify_coords(const Vector2 &coords) const { if (coords.x() >= _width) { throw "X coordinate cannot be higher than or equal to bounds width"; } if (coords.y() >= _height) { throw "Y coordinate cannot be higher than or equal to bounds height"; } } Bounds Bounds::operator*(const Bounds &bounds) const { return Bounds( {.width = _width * bounds.width(), .height = _height * bounds.height()}); } Bounds Bounds::operator+(const Bounds &bounds) const { return Bounds( {.width = _width + bounds.width(), .height = _height + bounds.height()}); }