diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-15 20:27:51 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-15 20:27:51 +0100 |
commit | 5dae8f8d10d506abc3c75a1f66c1dfe620c84fc1 (patch) | |
tree | 2bfb6efef0535a35bab1da811a5f69cb5203dff9 /src/app/app.cpp | |
parent | 9147551cd21d565f9503e3ebbcd2121e284d88d5 (diff) |
refactor: improve project design
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r-- | src/app/app.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp new file mode 100644 index 0000000..0942c3e --- /dev/null +++ b/src/app/app.cpp @@ -0,0 +1,26 @@ +#include "app.hpp" + +#include "app/maze.hpp" +#include "engine/bounds.hpp" +#include "engine/matrix.hpp" +#include "engine/vector2.hpp" + +#include <memory> +#include <string_view> + +void app_start(const AppOptions &app_options) +{ + Matrix<std::string_view> matrix(*app_options.maze_bounds() * + Bounds({.width = 2U, .height = 2U}) + + Bounds({.width = 1U, .height = 1U})); + + matrix.fill(app_options.wall()); + + auto start_pos = *app_options.start_coords() * Vector2({.x = 2U, .y = 2U}) + + Vector2({.x = 1U, .y = 1U}); + + matrix_to_maze<std::string_view>(&matrix, std::make_shared<Vector2>(start_pos), " ", + app_options.random_gen()); + + matrix.print(); +} |