From 578cf43e9c8384aab463aa2a33c5be00e46dc999 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 1 Jul 2022 17:27:49 +0200 Subject: refactor: matrix add get_size method --- src/engine/graphics/matrix.hpp | 2 ++ src/engine/graphics/matrix_impl.hpp | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/matrix.hpp b/src/engine/graphics/matrix.hpp index 58905ee..5964f0f 100644 --- a/src/engine/graphics/matrix.hpp +++ b/src/engine/graphics/matrix.hpp @@ -32,6 +32,8 @@ public: [[nodiscard]] auto get_column_cnt() const noexcept -> std::uint32_t override; + [[nodiscard]] auto get_size() const noexcept -> Bounds override; + [[nodiscard]] auto begin() const noexcept -> MatrixIterator override; [[nodiscard]] auto end() const noexcept -> MatrixIterator override; diff --git a/src/engine/graphics/matrix_impl.hpp b/src/engine/graphics/matrix_impl.hpp index 9105149..d2de795 100644 --- a/src/engine/graphics/matrix_impl.hpp +++ b/src/engine/graphics/matrix_impl.hpp @@ -81,6 +81,12 @@ auto Matrix::get_column_cnt() const noexcept -> std::uint32_t return _column_cnt; } +template +auto Matrix::get_size() const noexcept -> Bounds +{ + return Bounds({.width = _column_cnt, .height = _row_cnt}); +} + template auto Matrix::begin() const noexcept -> MatrixIterator { -- cgit v1.2.3-18-g5258