diff options
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r-- | src/app/app.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 0942c3e..d860b16 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -8,19 +8,21 @@ #include <memory> #include <string_view> -void app_start(const AppOptions &app_options) +App::App(const AppOptions &options) : _options(options) {} + +void App::run() { - Matrix<std::string_view> matrix(*app_options.maze_bounds() * + Matrix<std::string_view> matrix(*_options.maze_bounds * Bounds({.width = 2U, .height = 2U}) + Bounds({.width = 1U, .height = 1U})); - matrix.fill(app_options.wall()); + matrix.fill(_options.wall); - auto start_pos = *app_options.start_coords() * Vector2({.x = 2U, .y = 2U}) + + auto start_pos = *_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()); + _options.random_gen); matrix.print(); } |