|
| static void | parse_dimensions (const std::unordered_map< std::string, std::string > &args, unsigned int &rows, unsigned int &cols, unsigned int &levels) noexcept |
| | Parses the maze dimensions from the given arguments.
|
| static bool | has_distances (const std::unordered_map< std::string, std::string > &args) noexcept |
| | Checks if the "distances" argument is present in the given arguments.
|
| static configurator | build_configurator (const args &a, const algo default_algo=algo::DFS) noexcept |
| | Builds a configurator from the front entry of the given arguments.
|
| static state::ID | output_state_for (const std::unordered_map< std::string, std::string > &args) noexcept |
| | Determines the output state based on the given arguments.
|
|
static bool | advance_args (const runtime_app::context &ctx) noexcept |
|
static void | reseed_from_args (const std::unordered_map< std::string, std::string > &args, randomizer &rng) noexcept |
|
template<typename... Mappers> |
| static void | validate_mappers (Mappers &&...mapper) noexcept |
| static void | check_before_resize (grid_operations *ops, unsigned int rows, unsigned int cols, unsigned int levels) noexcept |
| | Resets the grid's topology (links) before each generation.
|
◆ build_configurator()
| configurator mazes::state_utils::build_configurator |
( |
const args & | a, |
|
|
const algo | default_algo = algo::DFS ) |
|
staticnoexcept |
Builds a configurator from the front entry of the given arguments.
Shared by every state implementing create_contract so arg parsing lives in one place.
- Parameters
-
| a | The parsed arguments |
| default_algo | The algorithm used when the arguments do not select one |
- Returns
- A configurator populated with dimensions, distances, algorithm and mask source
◆ check_before_resize()
| void mazes::state_utils::check_before_resize |
( |
grid_operations * | ops, |
|
|
unsigned int | rows, |
|
|
unsigned int | cols, |
|
|
unsigned int | levels ) |
|
staticnoexcept |
Resets the grid's topology (links) before each generation.
resize() always clears cell links even when dimensions are unchanged; without this, repeated maze generation at the same size (e.g. rebuilding on keypress) would keep linking new random walls on top of the previous maze's links, so the maze gradually loses walls / becomes fully open over time.
- Parameters
-
| ops | Pointer to the grid operations. |
| rows | Desired number of rows. |
| cols | Desired number of columns. |
| levels | Desired number of levels. |
◆ has_distances()
| bool mazes::state_utils::has_distances |
( |
const std::unordered_map< std::string, std::string > & | args | ) |
|
|
staticnoexcept |
Checks if the "distances" argument is present in the given arguments.
This function checks if the "distances" argument is present in the provided
- Parameters
-
| args | The arguments to check for the "distances" key. |
- Returns
- True if the "distances" argument is present, false otherwise.
◆ output_state_for()
| state::ID mazes::state_utils::output_state_for |
( |
const std::unordered_map< std::string, std::string > & | args | ) |
|
|
staticnoexcept |
Determines the output state based on the given arguments.
- Parameters
-
| args | The arguments containing the output information. |
- Returns
- The corresponding state::ID for the output.
◆ parse_dimensions()
| void mazes::state_utils::parse_dimensions |
( |
const std::unordered_map< std::string, std::string > & | args, |
|
|
unsigned int & | rows, |
|
|
unsigned int & | cols, |
|
|
unsigned int & | levels ) |
|
staticnoexcept |
Parses the maze dimensions from the given arguments.
- Parameters
-
| args | The arguments containing the dimension information. |
| rows | Reference to store the number of rows. |
| cols | Reference to store the number of columns. |
| levels | Reference to store the number of levels. |
The documentation for this class was generated from the following file: