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