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

State for creating a maze using the pixels algorithm. More...

#include <pixels_create_state.h>

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

Public Member Functions

 pixels_create_state (const runtime_app::context &ctx, mazes::runtime_stack *stack)
 Construct a new pixels maze creation state.
std::any create (const args &a, randomizer &rng) noexcept override
 Creates a maze using the specified algorithm and 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::write_to_output_state
 write_to_output_state (const runtime_app::context &ctx, runtime_stack *stack)
 Construct a new write to output state.
bool update (randomizer &rng, double delta_time) noexcept override final
 Update the state with the given arguments and delta time Common logic for parsing arguments, creating output, and writing to file.
void draw () const noexcept override
Public Member Functions inherited from mazes::state
 state (const runtime_app::context &c, runtime_stack *rs)

Protected Member Functions

bool write_output (const std::string &output_target, const std::string &output_content) noexcept override
 Write pixel data to image file in appropriate format.
Protected Member Functions inherited from mazes::write_to_output_state
configurator make_config (const args &a) noexcept
 Builds the configuration for create(), sizing it to the current grid.
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

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 Attributes inherited from mazes::write_to_output_state
args_manager * args_mapper
grid_manager * grid_mapper
processed_text_manager * processed_text_mapper
grid_identifier current_grid_id
std::string m_result

Detailed Description

State for creating a maze using the pixels algorithm.

Constructor & Destructor Documentation

◆ pixels_create_state()

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

Construct a new pixels maze creation state.

Parameters
ctxThe context of the runtime application
stackThe runtime stack

Member Function Documentation

◆ create()

std::any mazes::pixels_create_state::create ( const args & a,
randomizer & rng )
nodiscardoverridevirtualnoexcept

Creates a maze using the specified algorithm and parameters.

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

Implements mazes::create_contract.

◆ write_output()

bool mazes::pixels_create_state::write_output ( const std::string & output_target,
const std::string & output_content )
nodiscardoverrideprotectedvirtualnoexcept

Write pixel data to image file in appropriate format.

Implements mazes::write_to_output_state.


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