From a285df324deb579d262ea7cf484de4d6b11b28e4 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 6 Mar 2022 13:26:14 +0100 Subject: refactor: improve getters & setters for vector2 & bounds --- src/engine/graphics/string_matrix.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/string_matrix.cpp b/src/engine/graphics/string_matrix.cpp index aae2b9d..75d3700 100644 --- a/src/engine/graphics/string_matrix.cpp +++ b/src/engine/graphics/string_matrix.cpp @@ -1,10 +1,10 @@ #include "string_matrix.hpp" StringMatrix::StringMatrix(const Bounds &bounds) - : _rows(bounds.height()), _columns(bounds.width()) + : _rows(bounds.get_height()), _columns(bounds.get_width()) { - _matrix.reserve(bounds.height()); - _matrix.assign(_matrix.capacity(), std::vector(bounds.width())); + _matrix.reserve(bounds.get_height()); + _matrix.assign(_matrix.capacity(), std::vector(bounds.get_width())); }; void StringMatrix::fill(std::string_view element) @@ -22,12 +22,12 @@ void StringMatrix::fill(std::string_view element) std::string_view StringMatrix::get(const Vector2 &pos) const { - return _matrix[pos.y()][pos.x()]; + return _matrix[pos.get_y()][pos.get_x()]; } void StringMatrix::set(const Vector2 &pos, std::string_view element) { - _matrix[pos.y()][pos.x()] = element; + _matrix[pos.get_y()][pos.get_x()] = element; } unsigned int StringMatrix::rows() const -- cgit v1.2.3-18-g5258