Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
mazes::dfs_maze_create_state Class Referencefinal

State for creating a maze using the depth-first search algorithm. More...

#include <dfs_maze_create_state.h>

Inheritance diagram for mazes::dfs_maze_create_state:
[legend]
Collaboration diagram for mazes::dfs_maze_create_state:
[legend]

Public Member Functions

 dfs_maze_create_state (const runtime_app::context &ctx, runtime_stack *stack)
 Construct a new depth-first search maze creation state.
std::any create (const args &a, randomizer &rng) noexcept override
 Create a maze using the depth-first search algorithm.
Public Member Functions inherited from mazes::create_contract
template<typename T>
std::optional< T > create_as (const args &a, randomizer &rng) noexcept
 Calls create and extracts the result as T.
Public Member Functions inherited from mazes::state
 state (const runtime_app::context &c, runtime_stack *rs)

Additional Inherited Members

Public Types inherited from mazes::state
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
}
Protected Member Functions inherited from mazes::state
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

Detailed Description

State for creating a maze using the depth-first search algorithm.

Constructor & Destructor Documentation

◆ dfs_maze_create_state()

mazes::dfs_maze_create_state::dfs_maze_create_state ( const runtime_app::context & ctx,
runtime_stack * stack )
explicit

Construct a new depth-first search maze creation state.

Parameters
ctxThe runtime context
stackThe runtime stack to allow pushing/popping states

Member Function Documentation

◆ create()

std::any mazes::dfs_maze_create_state::create ( const args & a,
randomizer & rng )
overridevirtualnoexcept

Create a maze using the depth-first search algorithm.

Parameters
configThe maze configuration
rngThe randomizer for the algorithm
Returns
A string view with the result message

Implements mazes::link_maze_and_create_state.


The documentation for this class was generated from the following file: