#include "bounds.hpp" Bounds::Bounds(const BoundsOptions &options) : _width(options.width), _height(options.height) { } uint32_t Bounds::get_width() const noexcept { return _width; } void Bounds::set_width(uint32_t width) noexcept { _width = width; } uint32_t Bounds::get_height() const noexcept { return _height; } void Bounds::set_height(uint32_t height) noexcept { _height = height; } CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept { if (static_cast(coords.get_x()) >= _width) { return CoordsValidation::X_HIGH; } if (static_cast(coords.get_x()) <= 0) { return CoordsValidation::X_LOW; } if (static_cast(coords.get_y()) >= _height) { return CoordsValidation::Y_HIGH; } if (static_cast(coords.get_y()) <= 0) { return CoordsValidation::Y_LOW; } return CoordsValidation::VALID; } const Bounds &Bounds::operator*=(const Bounds &bounds) noexcept { _width *= bounds._width; _height *= bounds._height; return *this; } const Bounds &Bounds::operator+=(const Bounds &bounds) noexcept { _width += bounds._width; _height += bounds._height; return *this; } const Bounds &Bounds::operator-=(const Bounds &bounds) noexcept { _width -= bounds._width; _height -= bounds._height; return *this; }