aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/bounds.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-14 18:02:18 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commitdc6222611ad14a33f642396558ba84ecba9d6605 (patch)
treed759020233b66be62c5539209a03842d283b67a9 /src/engine/data/bounds.cpp
parentdbab54ebf134b6ab2cf719d7c26a191fbffeed34 (diff)
perf: add noexcept almost everywhere
Diffstat (limited to 'src/engine/data/bounds.cpp')
-rw-r--r--src/engine/data/bounds.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp
index 41b6dc0..fdf8c6b 100644
--- a/src/engine/data/bounds.cpp
+++ b/src/engine/data/bounds.cpp
@@ -1,48 +1,48 @@
#include "bounds.hpp"
-Bounds::Bounds(const BoundsOptions &options)
+Bounds::Bounds(const BoundsOptions &options) noexcept
: _width(options.width), _height(options.height)
{
}
-uint32_t Bounds::get_width() const noexcept
+Bounds::Value Bounds::get_width() const noexcept
{
return _width;
}
-void Bounds::set_width(uint32_t width) noexcept
+void Bounds::set_width(Bounds::Value width) noexcept
{
_width = width;
}
-uint32_t Bounds::get_height() const noexcept
+Bounds::Value Bounds::get_height() const noexcept
{
return _height;
}
-void Bounds::set_height(uint32_t height) noexcept
+void Bounds::set_height(Bounds::Value height) noexcept
{
_height = height;
}
CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept
{
- if (static_cast<uint32_t>(coords.get_x()) >= _width)
+ if (static_cast<Bounds::Value>(coords.get_x()) >= _width)
{
return CoordsValidation::X_HIGH;
}
- if (static_cast<uint32_t>(coords.get_x()) <= 0)
+ if (static_cast<Bounds::Value>(coords.get_x()) <= 0)
{
return CoordsValidation::X_LOW;
}
- if (static_cast<uint32_t>(coords.get_y()) >= _height)
+ if (static_cast<Bounds::Value>(coords.get_y()) >= _height)
{
return CoordsValidation::Y_HIGH;
}
- if (static_cast<uint32_t>(coords.get_y()) <= 0)
+ if (static_cast<Bounds::Value>(coords.get_y()) <= 0)
{
return CoordsValidation::Y_LOW;
}