#pragma once #include "interfaces/matrix.hpp" #include "engine/data/bounds.hpp" #include "engine/data/vector2.hpp" #include #include /** * A Matrix. */ class StringMatrix : public IMatrix { public: /** * Creates a matrix. * * @param bounds The bounds of the matrix */ explicit StringMatrix(const Bounds &bounds); /** * Fills the matrix with a element. * * @param element A element */ void fill(std::string_view element) override; /** * Returns a element of the matrix. * * @param pos The position of a element */ [[nodiscard]] std::string_view get(const Vector2 &pos) const override; /** * Sets a element of the matrix. * * @param pos The position of a element * @param element A new element */ void set(const Vector2 &pos, std::string_view element) override; /** * Returns the number of rows the matrix has. */ [[nodiscard]] unsigned int rows() const override; /** * Returns the number of columns the matrix has. */ [[nodiscard]] unsigned int columns() const override; private: std::vector> _matrix; unsigned int _rows; unsigned int _columns; };