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

State for parsing arguments. More...

#include <parsing_state.h>

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

Public Member Functions

 parsing_state (const runtime_app::context &ctx, runtime_stack *rs)
std::any create (const args &a, randomizer &rng) noexcept override
 Normalizes the raw input into a canonical, space-separated string.
void draw () const noexcept override
bool update (randomizer &rng, double delta_time) noexcept override
 Updates the state of the parsing process.
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 parsing arguments.

Member Function Documentation

◆ create()

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

Normalizes the raw input into a canonical, space-separated string.

Collapses whitespace and splits "--opt=value" into "--opt value"

Returns
The canonical string as std::string, or an empty std::any if the input is empty

Implements mazes::create_contract.

◆ draw()

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

Implements mazes::state.

◆ update()

bool mazes::parsing_state::update ( randomizer & rng,
double delta_time )
nodiscardoverridevirtualnoexcept

Updates the state of the parsing process.

Parameters
rngRandomizer to use for the update
delta_timeTime elapsed since the last update
Returns
True if the update was successful, false otherwise

Implements mazes::state.


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