Maze Builder Docs 8.2.1
Loading...
Searching...
No Matches
bt_maze_create_state.h
Go to the documentation of this file.
1#ifndef BT_MAZE_CREATE_STATE
2#define BT_MAZE_CREATE_STATE
3
6#include <MazeBuilder/state.h>
7
8#include <string_view>
9#include <string>
10
13namespace mazes
14{
15 class args;
16 class configurator;
17 class randomizer;
18 class runtime_stack;
19 struct context;
20
22 class bt_maze_create_state final : public create_contract, public state
23 {
24 public:
29
37 std::string_view create(const configurator& config, randomizer& rng) noexcept override;
38
40 void draw() const noexcept override;
41
46 bool update(const std::optional<args>& args, double delta_time) noexcept override;
47
48 private:
55 std::string_view create_bt_maze(unsigned int rows, unsigned int cols, unsigned int levels,
56 randomizer& rng) noexcept;
57
58 grid_manager* grid_mapper;
59 processed_text_manager* processed_text_mapper;
60 grid_identifier m_grid_id;
61 bool m_use_distances;
62 int m_distances_start;
63 int m_distances_end;
64 std::string m_result;
65 };
66} // namespace mazes
67
68#endif // BT_MAZE_CREATE_STATE
Command-line argument handler with JSON support.
Definition args.h:19
State for creating a maze using the binary tree algorithm.
Definition bt_maze_create_state.h:23
bt_maze_create_state(const runtime_app::context &ctx, runtime_stack *stack)
Construct a new binary tree maze creation state.
void draw() const noexcept override
@TODO -> pre-print mazes as a visualization technique
bool update(const std::optional< args > &args, double delta_time) noexcept override
Update the state with the given arguments and delta time.
std::string_view create(const configurator &config, randomizer &rng) noexcept override
Create a binary tree maze with the given parameters.
Configuration class for arguments.
Definition configurator.h:21
Contract for the create function in the runtime.
Definition create_contract.h:16
Provides random-number generating capabilities.
Definition randomizer.h:15
Class representing the runtime stack of states in the maze builder application.
Definition runtime_stack.h:23
struct representing the context passed to states in the runtime_app stack
Definition runtime_app.h:34
struct representing a state in the runtime stack
Definition state.h:18