aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics/string_matrix.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-06 13:26:14 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:54 +0200
commita285df324deb579d262ea7cf484de4d6b11b28e4 (patch)
treee2d181d58a09826c318d7aab5bee66bad3cf484a /src/engine/graphics/string_matrix.cpp
parent0e40bc7ce8c3b3be083002f88c3317d65f6570ad (diff)
refactor: improve getters & setters for vector2 & bounds
Diffstat (limited to 'src/engine/graphics/string_matrix.cpp')
-rw-r--r--src/engine/graphics/string_matrix.cpp10
1 files changed, 5 insertions, 5 deletions
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<std::string_view>(bounds.width()));
+ _matrix.reserve(bounds.get_height());
+ _matrix.assign(_matrix.capacity(), std::vector<std::string_view>(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