Maze Builder Docs
8.2.1
Loading...
Searching...
No Matches
dfs_maze_create_state.h
Go to the documentation of this file.
1
#ifndef DFS_MAZE_CREATE_STATE_H
2
#define DFS_MAZE_CREATE_STATE_H
3
4
#include <
MazeBuilder/configurator.h
>
5
#include <
MazeBuilder/create_contract.h
>
6
#include <
MazeBuilder/resource_identifiers.h
>
7
#include <
MazeBuilder/state.h
>
8
9
#include <string_view>
10
#include <string>
11
14
namespace
mazes
15
{
16
class
args;
17
class
randomizer;
18
class
runtime_stack;
19
struct
context;
20
22
class
dfs_maze_create_state
final :
public
create_contract
,
public
state
23
{
24
public
:
25
// Constructor
26
explicit
dfs_maze_create_state
(
const
runtime_app::context
& ctx,
runtime_stack
* stack);
27
35
std::string_view
create
(
const
configurator
& config,
randomizer
& rng)
noexcept
override
;
36
37
void
draw() const noexcept override;
38
43
bool
update
(const std::optional<
args
>&
args
,
double
delta_time) noexcept override;
44
45
private:
52
std::string_view create_dfs_maze(
unsigned
int
rows,
unsigned
int
cols,
unsigned
int
levels,
53
randomizer
& rng) noexcept;
54
55
grid_manager
* grid_mapper;
56
processed_text_manager
* processed_text_mapper;
57
grid_identifier m_grid_id{grid_identifier::BASIC};
58
bool
m_use_distances{
false
};
59
int
m_distances_start{configurator::DEFAULT_DISTANCES_START};
60
int
m_distances_end{configurator::DEFAULT_DISTANCES_END};
61
std::string m_result;
62
};
63
}
// namespace mazes
64
65
#endif
// DFS_MAZE_CREATE_STATE_H
mazes::args
Command-line argument handler with JSON support.
Definition
args.h:19
mazes::configurator
Configuration class for arguments.
Definition
configurator.h:21
mazes::create_contract
Contract for the create function in the runtime.
Definition
create_contract.h:16
mazes::dfs_maze_create_state
State for creating a maze using the depth-first search algorithm.
Definition
dfs_maze_create_state.h:23
mazes::dfs_maze_create_state::update
bool update(const std::optional< args > &args, double delta_time) noexcept override
Update the state of the maze creation.
mazes::dfs_maze_create_state::create
std::string_view create(const configurator &config, randomizer &rng) noexcept override
Create a maze using the depth-first search algorithm.
mazes::randomizer
Provides random-number generating capabilities.
Definition
randomizer.h:15
mazes::resource_management< grid_interface, grid_identifier >
mazes::runtime_stack
Class representing the runtime stack of states in the maze builder application.
Definition
runtime_stack.h:23
configurator.h
create_contract.h
resource_identifiers.h
state.h
mazes::runtime_app::context
struct representing the context passed to states in the runtime_app stack
Definition
runtime_app.h:34
mazes::state
struct representing a state in the runtime stack
Definition
state.h:18
include
MazeBuilder
dfs_maze_create_state.h
Generated by
1.12.0