blob: d860b16f5216200cc573543bee3b9ba50580b2c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "app.hpp"
#include "app/maze.hpp"
#include "engine/bounds.hpp"
#include "engine/matrix.hpp"
#include "engine/vector2.hpp"
#include <memory>
#include <string_view>
App::App(const AppOptions &options) : _options(options) {}
void App::run()
{
Matrix<std::string_view> matrix(*_options.maze_bounds *
Bounds({.width = 2U, .height = 2U}) +
Bounds({.width = 1U, .height = 1U}));
matrix.fill(_options.wall);
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), " ",
_options.random_gen);
matrix.print();
}
|