From 5dae8f8d10d506abc3c75a1f66c1dfe620c84fc1 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 15 Feb 2022 20:27:51 +0100 Subject: refactor: improve project design --- src/app/app.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/app/app.cpp (limited to 'src/app/app.cpp') 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 +#include + +void app_start(const AppOptions &app_options) +{ + Matrix 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(&matrix, std::make_shared(start_pos), " ", + app_options.random_gen()); + + matrix.print(); +} -- cgit v1.2.3-18-g5258