Maze Builder Docs 8.2.1
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::string_view create (const configurator &config, randomizer &rng) noexcept override
 Create a binary tree maze with the given parameters.
 
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.
 
- Public Member Functions inherited from mazes::create_contract
- 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 {
  BTING = 0 , DFSING = 1 , EMPTY = 2 , LOADING = 3 ,
  PARSING = 4 , PIXELIZING = 5 , SIDEWINDERING = 6 , STRINGIFYING = 7 ,
  WAVEFRONT_OBJECTIFYING = 8 , TOTAL = 9
}
 
- 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::contextget_context () const noexcept
 
runtime_stackget_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::string_view mazes::bt_maze_create_state::create ( const configurator & config,
randomizer & rng )
overridevirtualnoexcept

Create a binary tree maze with the given parameters.

Parameters
a
rows
cols
levels
rng
Returns

Implements mazes::create_contract.

◆ draw()

void mazes::bt_maze_create_state::draw ( ) const
overridevirtualnoexcept

@TODO -> pre-print mazes as a visualization technique

Implements mazes::state.

◆ update()

bool mazes::bt_maze_create_state::update ( const std::optional< args > & args,
double delta_time )
overridevirtualnoexcept

Update the state with the given arguments and delta time.

Parameters
argsOptional arguments for the update
delta_timeTime elapsed since the last update
Returns
True if the state was updated successfully, false otherwise

Implements mazes::state.


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