Base state for creating output from mazes (pixels, stringify, OBJ) This state encapsulates the common setup, creation, and output-writing logic for states that generate maze output in various formats. The output argument is either a file path (the extension selects the format) or a bare keyword that prints to stdout: "stdout" (plain string), "obj" (Wavefront OBJ), "b64" (base64-encoded string).
More...
#include <write_to_output_state.h>
|
| configurator | make_config (const args &a) noexcept |
| | Builds the configuration for create(), sizing it to the current grid.
|
| virtual bool | write_output (const std::string &output_target, const std::string &output_content) noexcept=0 |
| | Write the output to the target destination Subclasses should override this to handle format-specific writing.
|
|
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 |
|
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 output from mazes (pixels, stringify, OBJ) This state encapsulates the common setup, creation, and output-writing logic for states that generate maze output in various formats. The output argument is either a file path (the extension selects the format) or a bare keyword that prints to stdout: "stdout" (plain string), "obj" (Wavefront OBJ), "b64" (base64-encoded string).
◆ write_to_output_state()
Construct a new write to output state.
- Parameters
-
| ctx | The runtime context |
| stack | The runtime stack to allow pushing/popping states |
◆ draw()
| void mazes::write_to_output_state::draw |
( |
| ) |
const |
|
overridevirtualnoexcept |
◆ make_config()
|
|
nodiscardprotectednoexcept |
Builds the configuration for create(), sizing it to the current grid.
Also selects current_grid_id from the distances argument
◆ update()
| bool mazes::write_to_output_state::update |
( |
randomizer & | rng, |
|
|
double | delta_time ) |
|
finaloverridevirtualnoexcept |
Update the state with the given arguments and delta time Common logic for parsing arguments, creating output, and writing to file.
- 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.
◆ write_output()
| virtual bool mazes::write_to_output_state::write_output |
( |
const std::string & | output_target, |
|
|
const std::string & | output_content ) |
|
nodiscardprotectedpure virtualnoexcept |
The documentation for this class was generated from the following file: