From 38f14606c78c119d452f302f17329455e29a9a6f Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 10 Mar 2022 19:12:31 +0100 Subject: refactor: rename game initializer & move input config --- src/engine/data/bounds.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/engine/data/bounds.cpp') diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp index acd98af..41b6dc0 100644 --- a/src/engine/data/bounds.cpp +++ b/src/engine/data/bounds.cpp @@ -32,11 +32,21 @@ CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept 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; } -- cgit v1.2.3-18-g5258