Base state for creating mazes using algorithms that link cells This state encapsulates the common setup and teardown logic for maze-generating algorithms like binary tree, depth-first search, and sidewinder.
More...
#include <link_maze_and_create_state.h>
|
| virtual algo | get_algo_id () const noexcept=0 |
| | Get the algorithm ID for this maze creation algorithm.
|
| std::string | run_link_algorithm (const std::function< bool(grid_operations &)> &link_algorithm) noexcept |
| | Runs a linking algorithm on the current grid, then calculates distances if requested.
|
|
void | request_stack_push (ID state_id) const noexcept |
|
void | request_stack_pop () const noexcept |
|
void | request_stack_clear () const noexcept |
|
const runtime_app::context & | get_context () const noexcept |
|
runtime_stack & | get_stack () const noexcept |
|
|
args_manager * | args_mapper |
|
grid_manager * | grid_mapper |
|
processed_text_manager * | processed_text_mapper |
|
grid_identifier | current_grid_id |
|
bool | m_use_distances |
|
int | m_distances_start |
|
int | m_distances_end |
|
std::string | m_result |
|
| enum class | ID : unsigned int {
EMPTY = 0
, LINK_WITH_BINARY_TREE = 1
, LINK_WITH_DFS = 2
, LINK_WITH_SIDEWINDER = 3
,
LINK_WITH_PRIMS = 4
, LOAD = 5
, PARSE = 6
, WRITE_TO_IMAGE = 7
,
WRITE_TO_STRING = 8
, WRITE_TO_WF_OBJ = 9
, LINK_WITH_MASKED = 10
, TOTAL = 11
} |
Base state for creating mazes using algorithms that link cells This state encapsulates the common setup and teardown logic for maze-generating algorithms like binary tree, depth-first search, and sidewinder.
◆ link_maze_and_create_state()
Construct a new link maze and create state.
- Parameters
-
| ctx | The runtime context |
| stack | The runtime stack to allow pushing/popping states |
◆ create()
| std::any mazes::link_maze_and_create_state::create |
( |
const args & | a, |
|
|
randomizer & | rng ) |
|
nodiscardoverridepure virtualnoexcept |
◆ draw()
| void mazes::link_maze_and_create_state::draw |
( |
| ) |
const |
|
overridevirtualnoexcept |
◆ get_algo_id()
| virtual algo mazes::link_maze_and_create_state::get_algo_id |
( |
| ) |
const |
|
nodiscardprotectedpure virtualnoexcept |
Get the algorithm ID for this maze creation algorithm.
- Returns
- The algorithm ID to use in the configurator
◆ run_link_algorithm()
| std::string mazes::link_maze_and_create_state::run_link_algorithm |
( |
const std::function< bool(grid_operations &)> & | link_algorithm | ) |
|
|
nodiscardprotectednoexcept |
Runs a linking algorithm on the current grid, then calculates distances if requested.
- Parameters
-
| link_algorithm | Links the grid's cells; returns false if it could not |
- Returns
- A result message, or an empty string on failure
◆ update()
| bool mazes::link_maze_and_create_state::update |
( |
randomizer & | rng, |
|
|
double | delta_time ) |
|
finaloverridevirtualnoexcept |
Update the state with the given arguments and delta time Common logic for parsing arguments, setting up configuration, and handling output.
- Parameters
-
| rng | The randomizer for the algorithm |
| delta_time | Time elapsed since the last update |
- Returns
- False to indicate the state has completed (pops itself from the stack)
Implements mazes::state.
The documentation for this class was generated from the following file: