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

State for creating a maze using the binary tree algorithm. More...

#include <bt_maze_create_state.h>

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

Public Member Functions

 bt_maze_create_state (const runtime_app::context &ctx, runtime_stack *stack)
 Construct a new binary tree maze creation state.
std::any create (const args &a, randomizer &rng) noexcept override
 Create a binary tree maze with the given parameters.
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 binary tree algorithm.

Constructor & Destructor Documentation

◆ bt_maze_create_state()

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

Construct a new binary tree maze creation state.

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

Member Function Documentation

◆ create()

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

Create a binary tree maze with the given parameters.

Parameters
rowsThe number of rows in the maze
colsThe number of columns in the maze
levelsThe number of levels in the maze
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: